Meaningless Drivel is fun!*
The moose likes JSP and the fly likes Prevent user from Clicking while the jsp page is getting loaded. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Prevent user from Clicking while the jsp page is getting loaded." Watch "Prevent user from Clicking while the jsp page is getting loaded." New topic
Author

Prevent user from Clicking while the jsp page is getting loaded.

Tanumon Samanta
Greenhorn

Joined: Aug 24, 2012
Posts: 7
Hi,

I am unable to prevent an user from clicking while a jsp page is getting loaded. I want to prevent the user from changing any filed in the jsp page while the page is being submitted. Need your help here.
K. Tsang
Bartender

Joined: Sep 13, 2007
Posts: 2242
    
    7

If you are talking about forms, then I believe JavaScript should do the trick by setting the fields to read-only when the submit button clicked.


K. Tsang JavaRanch SCJP5 SCJD/OCM-JD OCPJP7 OCPWCD5
Tanumon Samanta
Greenhorn

Joined: Aug 24, 2012
Posts: 7
K. Tsang wrote:If you are talking about forms, then I believe JavaScript should do the trick by setting the fields to read-only when the submit button clicked.


Yes, it will work but there are radio buttons, calendar and many other things. Is there any other option???
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15957
    
  19

Yes. Hire trolls and orcs carrying big clubs with nails in them to stand behind the users and instruct them to bash anyone who does that.

If users can screw up, they'll not only do it, they'll find ways to screw up that even your worst hallucinations couldn't envision.

The only thing that really needs actual protection once you submit a page are the controls that can do another submit before the first one has replaced the current page with the submit response. That means primarily Submit buttons, but if you have AJAX controls, they, too need protection. Otherwise you end up with concurrent submit requests.

Seriously, though, if you cannot recruit enough trolls and orcs, create a DIV that covers the entire window client area and push it to the top of the Z-axis stack as part of the submit. This will effectively wall off all the sensitive parts of the screen, since all the clicks will hit the DIV and bounce. Bonus points for putting an onclick handler on the div that pops up an insulting dialog.

Due to timing issues, it's possible that people could still double-submit, but they'll have to be much quicker about it.


Customer surveys are for companies who didn't pay proper attention to begin with.
Esteban Herrera
author
Greenhorn

Joined: Dec 25, 2004
Posts: 21

As Tim said, you can block the page with something like http://www.malsup.com/jquery/block/.
Bill Clar
Ranch Hand

Joined: Sep 21, 2006
Posts: 150

Tim Holloway wrote:Bonus points for putting an onclick handler on the div that pops up an insulting dialog.


Thanks for the laugh, Tim.

Tim Holloway wrote:
Due to timing issues, it's possible that people could still double-submit, but they'll have to be much quicker about it.


Could a double-submit occur if all submit buttons are disabled via javascript's "onClick"?
Jayesh A Lalwani
Bartender

Joined: Jan 17, 2008
Posts: 2273
    
  28

Tim Holloway wrote:

Seriously, though, if you cannot recruit enough trolls and orcs, create a DIV that covers the entire window client area and push it to the top of the Z-axis stack as part of the submit. This will effectively wall off all the sensitive parts of the screen, since all the clicks will hit the DIV and bounce. Bonus points for putting an onclick handler on the div that pops up an insulting dialog.


Right.. I call it the Iron Curtain
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Prevent user from Clicking while the jsp page is getting loaded.
 
Similar Threads
Content type Issue
content-type issue
how to prevent double clicks on hyper link.
Preventing Old page to get loaded
Changing the curser while the page is loading