Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Tanumon Samanta
Greenhorn
Posts: 7
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 3222
12
Android Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Tanumon Samanta
Greenhorn
Posts: 7
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 17624
39
Android Eclipse IDE Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Esteban Herrera
author
Ranch Hand
Posts: 41
1
Eclipse IDE Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As Tim said, you can block the page with something like http://www.malsup.com/jquery/block/.
 
Bill Clar
Ranch Hand
Posts: 163
Eclipse IDE Java Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Pie
Posts: 2756
32
Eclipse IDE Spring Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic