thinksysinc
asked on
FireFox and selected on page refresh
Based on this simple code:
<select>
<option value="0">S1</option>
<option value="2" selected>S2</option>
<option value="3">S3</option>
</select>
Both IE and FireFox make the default selected value 2 (like they should) but when the page is refreshed IE goes back to the value 2 but FireFox does not. FireFox remebers the value that was selected when the page was refreshed.
Anyone know how to make FF act like IE with this?
Thanks in advance.
<select>
<option value="0">S1</option>
<option value="2" selected>S2</option>
<option value="3">S3</option>
</select>
Both IE and FireFox make the default selected value 2 (like they should) but when the page is refreshed IE goes back to the value 2 but FireFox does not. FireFox remebers the value that was selected when the page was refreshed.
Anyone know how to make FF act like IE with this?
Thanks in advance.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
jasonsbytes -
Yup you can turn it off. I tested it and it works.
I can see the good in having it remember the values but what I am doing right now it is causing me problems.
Either way, thanks for the help.
Yup you can turn it off. I tested it and it works.
I can see the good in having it remember the values but what I am doing right now it is causing me problems.
Either way, thanks for the help.
no problem, thanks for the fun question and points!!! :)
I actually learned something too!
I actually learned something too!
A quick and dirty hack is to change the name of the form every time the page loads. Then FF resets all the form data to the defaults for instance:
<form name="testForm<?PHP echo rand(0,9999);?>">
<input type="text" value="test">
</form>
the other option is to set all the form data to defaults with JS, for instance:
<script language="Javascript">
window.onLoad = setTimeout("setdefaults()" , 1000);
function setdefaults(){
document.getElementById('t estText'). value = 'Default Value';
}
</script>
<form name="testForm">
<input type="text" name="testText" id="testText" value="test">
</form>
<form name="testForm<?PHP echo rand(0,9999);?>">
<input type="text" value="test">
</form>
the other option is to set all the form data to defaults with JS, for instance:
<script language="Javascript">
window.onLoad = setTimeout("setdefaults()"
function setdefaults(){
document.getElementById('t
}
</script>
<form name="testForm">
<input type="text" name="testText" id="testText" value="test">
</form>
http://developer.mozilla.org/en/docs/How_to_Turn_Off_Form_Autocompletion
Hope it works!