Fire Fox – Bug or feature ?

Was working on a very simple form and found out that Firefox behaves differently in case of Form Reset.

The problem is, Firefox is unable to reset “hidden” inputs in the form, Internet explorer on the other hand clears out all the variables of the form. A simple code to check the same is below..

<script>
function someFunction() {
document.getElementById(‘hid’).value = “Hiding”;
document.getElementById(‘vis’).value = “Visible”;
}
</script>

<form name=”one” id=”one”>

<input type=”hidden” id=”hid” name=”hid” value=””>
<input type=”text” id=”vis” name=”vis” value=””>

<input type=”button” value=”click” onclick=”someFunction()”>
<input type=”reset” value=”Reset form”>
<input type=”button” value=”What is in Hidden Field?” onClick=”alert(document.getElementById(‘hid’).value)”>
</form>

If you want to have a look at this working example. Open >>this<< in both the browsers.

These are tested in Firefox 2.0.0.8 and IE 6.0

Ofcourse, there are other “bug-or-feature-god-knows” such as after an F5, the hidden values still retain values.. A Strong Reload (CTRL-F5) should be done.. More details here.

Leave a Reply

Your email address will not be published. Required fields are marked *