File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes HTML, CSS and JavaScript and the fly likes submit button Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "submit button " Watch "submit button " New topic

submit button

saravanan kanda swamy
Ranch Hand

Joined: Apr 21, 2004
Posts: 33

I have a problem like ,I have a JSP page which will be direct to action class. Once the user clicks the submit button the request goes to the action class but before the user receives any response, when it is still processing the user clicks submit button multiple times.

Which in turn resulting in multiple request i want to avoid this when the user is clicks the submit button first time it should process it should leave the other request (the requests he clicks after the first one)

Thanks in advance.

Yuriy Fuksenko
Ranch Hand

Joined: Feb 02, 2001
Posts: 413
I am copying that from this

Just believe me - user could always srew something up. As far as I remember, the following things where done in such situation, but none of them is flawless:
1. Setting a flags
2. Disabling a link.
3. Showing a transparent DIV on top of whole page (page will became "readonly") for couple seconds. setTimeout should be used to remove this DIV, in case user clicks Stop button. - I like this one.
4. doing something like <A href='#' onclick='submitIt()' ondblclick='submitIt()'>
5. whole bunch of server side things - session and request flags, and so on

Here is an example for option 3:

saravanan kanda swamy
Ranch Hand

Joined: Apr 21, 2004
Posts: 33
We got the solution for the problem , we are going with disabling the submit button with a javacript onlclick which will trun off all the other request.

Sorry for the late reply.

I agree. Here's the link:
subject: submit button
It's not a secret anymore!