Entry
How can I achieve the same as using a "reset" button, in JavaScript?
Jul 31st, 2001 00:24
Joe Lipman, Kevin Smith,
I would have assumed that it was the reset() method
eg.
<FORM NAME="loadsaFields">
<INPUT NAME="fieldtoReset" VALUE="Hello">
</FORM>
and where header contains function to call upon
<SCRIPT LANGUAGE="JavaScript">
<!--
function resetMe() {
document.loadsaFields.reset();
}
//-->
</SCRIPT>
If you already have a reset button in your form, you can emulate the
click on the reset button
<FORM NAME="loadsaFields">
<INPUT NAME="fieldtoReset" VALUE="Hello">
<INPUT TYPE="reset" NAME="goingToReset" VALUE="Reset">
</FORM>
the header would contain
<SCRIPT LANGUAGE="JavaScript">
<!--
document.loadsaFields.goingToReset.click();
//-->
</SCRIPT>