Alternate Submit?
Dec 12, 2006I am making a ajax form request and I am clueless on how to make an alternate submit when javascript is disabled. This is so it works without javascript and uses a separate php file.
View 2 RepliesI am making a ajax form request and I am clueless on how to make an alternate submit when javascript is disabled. This is so it works without javascript and uses a separate php file.
View 2 RepliesI am generating a html based table with multiple rows of data coming
in real time from a postgres DB. The underlying technology is java
based however the front end is html.
now i am unable to alternate the colour of every row so that the table
is lot more readable. can anyone suggest a javascript or even a css
script which will alternate the row colours irrespective of the number
of rows.
the bug of onbeforeunload is so obvious!
in IE 6 it will popup twice "sometimes"
I am using the following code
window.onbeforeunload = null;
window.onbeforeunload = confirmExit;
var executingPostBack = false;
function confirmExit()
{
if ( typeof executingPostBack != 'undefined' && !executingPostBack)
{
return 'Warning: Modified data has not been saved.' ;
}
}
In some cases, IE pops up it twice, for example, when we click a link
that contains "__doPostBack", onbeforeunload is fired the first time;
when the form is submitted, it is fired second time.
There is no way to work it around, because onbeforeunload is stupid, we
can't know whether the user clicks OK or Cancel.
I would like to use the following code with confirm so that I know
exactly what the user behaves
res = confirm("leaving?");
if (res==1)
{
alert("yes");
}
else
{
alert("no");
}
but I can't use this in onbeforeunload, because I can't stop it!
onbeforeunload always asks for something return, but if I return
anything, it will popup!
I currently have some simple JS setup but I'd like to alternate between 2 values using "onclick". I have setup a flash clip with a form input buttons for playback control. Here is my form:
PHP Code:
<form action="/" class="button">
<input type="button" name="" id="play" class="play" value="" onclick="callFlashPlayPauseVideo(1)" />
</form>
[Code]....
However, once this intial stage has passed, and the button is clicked again - the image needs to revert back to the "play" button - so its a cause of having the pause button on show whilst the video plays, if its then clicked, the play button shows as the video is paused.
For a lot of years now I've used a javascript that does a simple rollover image swap, but also changes another alternate image at the same time. It's always worked like a charm.Lately I realized that the script no longer works in IE, though it used to in older versions of IE (I think it stopped working in anything past IE 7). It still works fine in Firefox, Safari, etc.I haven't been able to find a good alternative for this script, so I'm really trying to get it to work again in IE, but so far no luck.
Here's the link to the actual script itself. http:[ur;l]....
Here is a quick menu hidden in a Mouse Gesture for additional navigation on a site or administraitive duties.
To activate the menu simply right click anywhere on the screen , hold the button down, then move the mouse down 50px's and release. This will display the hidden menu.
There are two parts to it, first the Style and Script....
<style>
.expanded {
position:absolute;
padding:1px;
font:Arial, Helvetica, sans-serif;
font-size:11px;
text-align:left;
background-color:#D4D0C8;
width:150px;
border-left :2px solid #FFFFFF;
border-top :2px solid #FFFFFF;
border-right :2px solid #999999;
border-bottom : 2px solid #999999;
}
a.expanda {
padding-left:15px;
padding-right:15px;
display:block;
text-decoration:none;
color:#000000;
}
a.expanda:hover {
background-color:#003366;
color:#FFFFFF;
}
</style>
<script language="javascript">
document.oncontextmenu = null;
document.onmousedown = doDown;
document.onmouseup = doUp;
var timerID = 1;
var ly;
var ny;
var targ;
function doDown(e)
{
clearTimeout(timerID);
document.oncontextmenu = null;
var rightclick;
if (!e) e = window.event
if (e.which) rightclick = (e.which == 3);
else if (e.button) rightclick = (e.button == 2);
try
{
if (e.target) targ = e.target.getAttribute('id');
else if (e.srcElement) targ = e.srcElement.getAttribute('id');
if (targ != "navlink") {document.getElementById('altnav').style.display = 'none'}
}
catch(e)
{
document.getElementById('altnav').style.display = 'none'
}
if (rightclick != false)
{
ly = e.clientY;
}
return false;
}
function doUp(e)
{
var rightclick;
if (!e) e = window.event
if (e.which) rightclick = (e.which == 3);
else if (e.button) rightclick = (e.button == 2);
if (rightclick != false)
{
if (!e) var e = window.event;
ny=e.clientY;
lytemp = ly+50;
if (ny>lytemp)
{
document.getElementById('altnav').style.display = "block";
document.getElementById('altnav').style.left = e.clientX + 2;
document.getElementById('altnav').style.top = ly+2;
window.status = "down menu";
document.oncontextmenu = fakecontext;
timerID = setTimeout("document.getElementById('altnav').style.display = 'none'", 5000);
}
}
ly = null;
ny = null;
}
function fakecontext(){return false;};
</script>
And the menu div to place inside the body tag. Edit this to act as the menu you would like. Remember that you can access the event.target if you want to have the menu dynamicaly effect things based on whats clicked.
<div style="display:none" class="expanded" id="altnav">
<a href="http://www.news.com" class="expanda" id="navlink"><div style="float:right;width:20px;text-align:left;">Ctrl+?</div>Option 1</a>
<a href="http://www.cnn.com" class="expanda" id="navlink"><div style="float:right;width:20px;text-align:left;">Ctrl+?</div>Option 2</a>
</div>
I was actually looking for a couple of alternate form field elements such as a drag bar or combo boxes. Is there something like that out there, even? (see ascii representation for example of what I mean) Code:
View 7 Replies View RelatedThere are lots of JavaScripts and PHP scripts for making tables with alternating row colors. I'd like to know if there's a way to use JavaScript to give a table alternate row CLASSES.
My ultimate goal is to cut down on the html and gain more control over my table. I have a PHP script that gives me alternate cell colors, with different colors in each of two table columns. But it's just too complex to work with. Code:
I am building a display which is made up of a XHTML table, CSS styling and JS animation.
The effect I am looking for is for the (mutliple) cell's content to alternate between one word to another.
My initial idea was to build an array to count through the cell numbers like I have for another section of the board in this snippet..
var flsh = document.getElementsByTagName('td');
for (var i=0;i<flsh.length;i++); //flash alert cells
{
cell = !cell;
[Code]....
This code flashes some of the other cells each second, however for my alternating text I'm not sure what methods to use since .style.backroundColor wont suit this.
I have a project that I need to read some data from an XML file.
Something like:
However, since JS is a client side script so it can't read from client side, is there any alternate way to do this? I am thinking to create a "Data" class, and many "Data" objects, is this an elegant way to do it?
Basically i have a function that depending on which picture you click (one for "yes" and other for "no") it will make visible a textarea .
However right now if i click in "yes" it will display me the textarea for yes, and afterwards if i click "no" it will display both textareas, for yes and no. I want everytime i click on yes it will hide the "no" textarea and the same for when i click the "no" textarea, it will hide the "yes" textarea.
Code:
<!- * * * * * * * * * * * * O.S. Question * * * * * * * * * * * * * * * -->
Original Operating System ?</strong></span><div id="container">
<div id="left">
<img src="yes.png" onclick="document.getElementById('moreinfo22').style.display =
[Code].....
I am a little new to java script and jQuery so, if you can, please ignore my ignorance. I am creating a theme for Joomla and am calling in the website title using php. I would like so that every other word is a different color.
[Code]...
I would like to use jQuery to make every other word a different color in that specific span.
I have a javascript redirection with an alternate text for those who have javascript disabled.
It all works fine but before redirection the alternate text displays shortly. Can I prevent that?
Code:
I also tried to hide the text with an onload event, but nothing changes
Is there away to alternate DIV rows in a specific section. When I try to alternate the DIVs it alternates everything that is a DIV on the page. I want to just alternate a DIV table.
View 4 Replies View RelatedCode:
function stripeTables() {
if(!document.getElementsByTagName) return false;
var tables = document.getElementsByTagName("table");
for(var i=0;i<tables.length; i++) {
[code]....
how does the script know if odd is true or false? The script works, but I'm missing this one concept. Is "odd" a JS keyword or something?
how to loop alternate elements in JQuery starting from an given index. all the elements have same CLASS values.
View 2 Replies View RelatedIf a iframe src link is not available, how can i provide a default
site or alternate site for the iframe to use?
I would like a table to have alternating an alternating color per row. I also want to be able to remove or add a row and preserve every other row has a different color.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
[Code]....
if there's some effect in JQ that we can use to simulate rollover. Usually when user hovers a mouse over a link/image it changes its src/ background to another one (for example arrow.png -> arrow_o.png). So users feels like it is highlighted or similar. But we always must have 2 images (similar ones). Maybe there's some effect that can simulate this highligting/hover for user so we don't need to have 2 images. I understand it will never be as good as alternative image, but still.
View 12 Replies View RelatedI have written JS, in which I used activex control which does not work on mozila, anyone has idea to to same thing without activex , here is code which just upload the textfile contains on html page .
[Code]...
I've gotten accustomed to using coda slider 2.0 to do some cool interactive sliding elements on my pages. However, i need something similar that will fade instead of slide. I've searched all over their home forums and it seems like no one there has an answer for how to implement the change in the current codaslider infrastructure.[URL].. I need something that has all the functionality of coda slider (easy transitions, div's containing lots of content- both images and text, forward/back buttons, autoplay) but with a fade transitions
View 1 Replies View RelatedI am trying to create a form which when the submit button is selected will open a new window with 1 of 4 URLs based on the the combination of data in 2 select boxes.
For example:
if select box 1 = a and select box 2 = a then open new window with URL 1
if select box 1 = a and select box 2 = b then open new window with URL 2
if select box 1 = b and select box 2 = a then open new window with URL 3
if select box 1 = b and select box 2 = b then open new window with URL 4
I have following code which scroll images from left to right. Can I modify the code so that the images moves alternate.(i.e. left to right and again right to left)
var duration = 10000;
var speed = (parseInt($("div#container").width()) + parseInt($("div#viewer").width())) / duration;
var direction = "rtl";
(direction == "rtl") ? $("div#container").css("left", $("div#viewer").width()).addClass("rtl") : $("div#container").css("left", 0 - $("div#container").width()).addClass("ltr") ;
//animator function
[Code]...
I am using the ACRONYM tag to provide an explanation of codes within my
application. Example:
<p>The circuit <acronym title="Circuit P123T: Picton SS to Telebary
SS 345KV">P123T</acronym> is out
of service from 13:00 to 15:00 today</p>.
I would prefer a fancy balloon tip, but this allows me to store and retrieve
the text directly in a database table, and avoid having to add any
additional setup text to create any invisible balloon text. (Unless there is
another way).
I would like to change the style of the alternate text that appears, such as
increasing its font size and background color. Is there a way to do this as
CSS or in JavaScript ?
I have a grid of thumbnail divs, 3 columns wide, which alternate having the class .first, .second, .third, repeating for each row. The divs also have a class according to the category to which they are assigned. There is a menu which allows you to filter the thumbnails by category. So, when you choose a category, it hides any div that doesn't have a class with that category. What I need to do is, when the grid is filtered, somehow clear all the .first, .second, .third classes, and reassign them based on the items that remain visible.
View 2 Replies View RelatedI have a quiz embedded on my site that originates elsewhere (QuizRevolution.com) and is embedded on my site via a link (plus some other code), part of that code being in an iframe. The quiz contains YouTube videos that, because of how the quiz is set up by QuizRevolution, will not play in browsers/devices without Flash (for example, the iPad). What I would like to do is put some script on my site that will load a SECOND quiz from QuizRevolution (this one without video) for browsers/devices without Flash. This second quiz will substitute for the first one. Does anyone know how to do this? The tricky part seems to be how I have embedded the quiz in my site, so I have included that part of the page here:
[Code]....