Yea, Then hit refresh so it works again. The point is to keep the submit
button from being pressed twice. The javascript solution below is used very
commonly on web pages. It maybe suggested that after you hit the submit
button, then turn off the power switch. Not trying to be a smart guy here,
just trying to provide a user of this list a resonable solution. :-)
Kochanowicz
-----Original Message-----
From: A mailing list for discussion about Sun Microsystem's Java Servlet
API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of Kevin
Mukhar
Sent: Wednesday, April 18, 2001 10:48 AM
To: [EMAIL PROTECTED]
Subject: Re: Question??
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
___________________________________________________________________________
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