I stop duplicate records from being submitted by changing the value of the submit button. Since it sounds like you are posting to the same page, you may want to do this by changing the value of the submit button from Submit, to Submitting and finally Submitted. When the user clicks Submit, change the value to Submitting. And when you get the post back, set the value of the Submit button to Submitted. Check for the value of the Submit button in a submit function and only submit the form if the value of the button equals Submit.

Ie., if(myForm.btnSubmit.value != "Submit") return;
     myForm.btnSubmit.value="Submitting";
     ...any other validations you need to do, then...
     myForm.submit();

You can use whatever values for the submit button you like.

Another option is to not post to the same page.

There are a million flavors and the one you choose is up to your taste. This one saves resources on the server.
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to