Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why Reset button won't clear form?

Status
Not open for further replies.

moepower

Programmer
Oct 5, 2000
93
US
I have a two page survey form with the "Reset" button on the second page. The script for the "Reset" button is below:

<a href=&quot;document.forms[0].reset();&quot;><img NAME=&quot;clearbutton&quot; ALT=&quot;Reset&quot; SRC=&quot;/clear.gif&quot;></a>

Anything I type on Page 2 will clear when I click &quot;Reset&quot;. But if I type info on Page 2, click back to Page 1, go forward to page 2, then click &quot;Reset&quot; the information I typed in previously will not go away. If I type new information over the old, clicking &quot;Reset&quot; will bring the old information back. How can I solve this? My Page 2 has text fields, drop down boxes, and radio buttons.

Thank you.
 
Not sure exactly, but could be that when you come back to page 2, the browser keeps the values previously entered as the default values (reset restores the values to their default?) - which could explain why, when you enter new values and click reset, the values return to what was entered previously.

Unfortunately I can't think of a solution for you, but maybe my ramblings might prompt some ideas... ;)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top