[thelist] Submitting contents of form only once

Anthony Baratta Anthony at Baratta.com
Fri Jan 5 14:18:11 CST 2001

At 02:22 PM 1/5/2001 -0500, you wrote:
>Does anyone know an easy way, using JavaScript and/or ASP, to make a form be
>submitted only the first time a user clicks the Submit button? I'm doing a
>simple database insert with the contents of a form, and since it's a long
>form, users have a tendency to click the Submit button a few times.

Set a JavaScript variable in the header of your page
(something like var FormSubmitted = false;), then
when the form is submited check the FormSubmitted value
set to true if false, if false - don't submit the form.

You can use the onSubmit function to do the dirty work for you.

Anthony Baratta
Keyboard Jockeys

More information about the thelist mailing list