Closed Bug 285623 Opened 19 years ago Closed 19 years ago

Reset button does not reset <select> or <input type=hidden> form elements

Categories

(Firefox :: General, defect)

x86
Windows XP
defect
Not set
critical

Tracking

()

RESOLVED DUPLICATE of bug 158209

People

(Reporter: npm, Assigned: bugzilla)

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.6) Gecko/20050225 Firefox/1.0.1
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.6) Gecko/20050225 Firefox/1.0.1

Reset buttons only seem to clear <input type=text> fields, they do not reset
<select> elements or hidden elements back to their starting values.

Sample code --- CUT HERE ---
<body>
   <form id='test'>

    <br>Type something here<input id=first type=text size=20>
<BR>
This demonstrates something odd in Firefox.  I can delete an option
from the selection list and change the hidden value.  The reset button won't
restore either of
their default values.  The reload key will reset the select but not the hidden
or text input, but   
the force-reload will reload everything.<br>

    <BR><select id=thingey name=thingey size=3>
        <option value="a">a</option>
        <option value="b">b</option>
        <option value="c">c</option>
    </select>
    <br>
      1) Press this: <input type='button' value='See Hidden'
onclick='alert(document.getElementById("hidey").value);'>
    <br>
      <input name=hidey type='hidden' id=hidey value=''>
      2) Now this: <input type='button' value='Change Things'
onclick='setHidden(); document.getElementById("first").focus();'>
    <br>
      3) Now this again: <input type='button' value='See Hidden'
onclick='alert(document.getElementById("hidey").value);'>
    <br>
      4) Try this: <input type='reset' value='Reset'>
      <BR> Note that only the type=text box got reset... 
      5) This yet again: <input type='button' value='See Hidden'
onclick='alert(document.getElementById("hidey").value);'>
    <br>
    <br>

   </form>
</body>
</html>

Reproducible: Always

Steps to Reproduce:
1.Just run the supplied code
2.
3.

Actual Results:  
Reset does not reset the selection box nor the hidden input field

Expected Results:  
It should act just like forced-reload, but not actually reloading the page. 
i.e. it should reset all the fields to how they were when the page was first loaded.
dup bug140697 ?
Same here. This is a major / critical bug which will be corrupting data 
everywhere.
We already have 2k DB records with bad data in them now due to this.

My test case:
<html>
<head>
<body>
<form id="myform">
	<input type="hidden" id="detailid" name="detailid" value="0"><br>
	<input type="text" id="detailid2" name="detailid2" value="0"><br>
	<input type="button" onclick="document.getElementById( 'myform' ).reset
()" value="reset form"><br>
	<input type="button" onclick="alert( 'Hidden: ' + 
document.getElementById( 'detailid' ).value + '\n' + 'Text: ' + 
document.getElementById( 'detailid2' ).value )" value="show values"><br>
	<input type="button" onclick="document.getElementById
( 'detailid' ).value = 10; document.getElementById( 'detailid2' ).value = 10" 
value="set value"><br>
</form>
</body>
</html>
Duplicate of Bug #158209
Seems they dont want to fix critical issues like this its been broken and 
reported as such since 2002 very poor show.
dataloss should surely be classed as critical someone want to change the 
severity?
This is an automated message, with ID "auto-resolve01".

This bug has had no comments for a long time. Statistically, we have found that
bug reports that have not been confirmed by a second user after three months are
highly unlikely to be the source of a fix to the code.

While your input is very important to us, our resources are limited and so we
are asking for your help in focussing our efforts. If you can still reproduce
this problem in the latest version of the product (see below for how to obtain a
copy) or, for feature requests, if it's not present in the latest version and
you still believe we should implement it, please visit the URL of this bug
(given at the top of this mail) and add a comment to that effect, giving more
reproduction information if you have it.

If it is not a problem any longer, you need take no action. If this bug is not
changed in any way in the next two weeks, it will be automatically resolved.
Thank you for your help in this matter.

The latest beta releases can be obtained from:
Firefox:     http://www.mozilla.org/projects/firefox/
Thunderbird: http://www.mozilla.org/products/thunderbird/releases/1.5beta1.html
Seamonkey:   http://www.mozilla.org/projects/seamonkey/
This is still a problem in 1.0.7
This is still a problem in 1.0.7(In reply to comment #6)
> This is still a problem in 1.0.7

Forgot to mention, the code I first submitted still adequately demonstrates the
problem.  I bumped the severity up because apparently this is causing data
corruption issues for some folks.
Severity: normal → critical
Resetting selects worksforme (unless some of the missing parts of the comment 0
testcase were supposed to remove options and then reset, in which case: don't
do that, it doesn't work in pretty much any browser and is rather undefined).
And that only leaves the hidden inputs, which is exactly bug 158209

*** This bug has been marked as a duplicate of 158209 ***
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: