Re: Stop form submission?
by "Darrell King" <darrell(at)webctr.com>
|
Date: |
Thu, 27 Jan 2000 15:22:23 -0500 |
To: |
<hwg-techniques(at)mail.hwg.org> |
References: |
ADISWEB01 |
|
todo: View
Thread,
Original
|
|
>>>> I need some code that will stop subsequent form submissions in the
time between hitting submit and the submission acutally taking place.
in part of the application i am working on you can keep hitting submit
while its still
submitting the first request and like 5 or 6 records can be created
instead of just one, i can use javascript, asp or whatever, i just need
something, and it only has to work in ie 4 and 5.<<<
Catch the onSubmit event at the button, and change a flag on the page
(var SubmittedAlready=1;) to indicate that the button has already been
pushed.
Put a line before that change that checks the flag. If you set the flag
to 0 on loading, then it will be false the first time through, and you
can set it and proceed.
If the test indicates the submission has occurred, then return false,
and the submission is cancelled.
Only works if JavaScript is enabled.
Darrell
HWG hwg-techniques mailing list archives,
maintained by Webmasters @ IWA