Now try this test:
- press the form submit button
- before the page unloads and the response is displayed press the
browser stop button
- try to submit the form again
Tom & Sharon Kochanowicz wrote:
>
> Yes you can use javascript in your servlet. Here is an example. It also
> answers the question that has been floating around on this list on how to
> keep the submit button from being pressed more than once (disabling it after
> the first submit. I use it all the time & it works great.
>
> T. Kochanowicz
>
> // JavaScript To prevent user hitting Submit button too many times.
> htmlPage.append("<SCRIPT LANGUAGE=\"JavaScript\">
><!-- Hide script from
> old browsers\n ");
> htmlPage.append(" var submitted = false;");
> htmlPage.append(" function doSubmit(form)");
> htmlPage.append(" {");
> htmlPage.append(" if (!submitted) {");
> htmlPage.append(" submitted = true;");
> htmlPage.append(" form.submit();");
> htmlPage.append(" }");
> htmlPage.append(" }");
> htmlPage.append("// End hiding script from old
>browsers-->\n</SCRIPT>");
>
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html