beanbrain
Programmer
- Dec 31, 2001
- 170
I have a form that I want to reset after submission.
Once the form is submitted the values of the fields are submitted to a perl script which sents a verification back in the form of simple HTML code. When I hit the "Back" button I want the form to reset so that an end user cannot resend the same data by accident.
I have the following in the HEAD section of the form.
The form attributes are as follows.
Sometimes the form resets on the back button and sometimes not.
Note: I am calling this form from within another HTML page set up with two frames. This form being the top frame and a form that passes account numbers being the bottom frame.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
Once the form is submitted the values of the fields are submitted to a perl script which sents a verification back in the form of simple HTML code. When I hit the "Back" button I want the form to reset so that an end user cannot resend the same data by accident.
I have the following in the HEAD section of the form.
Code:
if (location.search == '') {
setTimeout('location += \'?reloaded\';', 500);
}
window.onload = function() {
if (location.search && location.search.length > 0) {
document.THISFORM.reset();
}
}
The form attributes are as follows.
Code:
<FORM METHOD=POST NAME="THISFORM" ACTION="[URL unfurl="true"]http://www.mylocation.org/cgi-bin/borf/process-pick.pl"[/URL] ONSUBMIT="javascript:return FormCheck(this)">
Sometimes the form resets on the back button and sometimes not.
Note: I am calling this form from within another HTML page set up with two frames. This form being the top frame and a form that passes account numbers being the bottom frame.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886