• Post Reply Bookmark Topic Watch Topic
  • New Topic

Button can be clicked only 4 times within 24 hours?  RSS feed

 
Rakesh Thawait
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I want to create a JSP page which has one button. Requirement of project is that button can be clicked only four times within 24 hours. After 24 hour it should again allow to click button for max four times. How can I do this? Please help.

Regards,
Rakesh Thawait
 
Rao Raghu
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can achieve this using a simple Javascript function



Hope you got the idea.

 
Rao Raghu
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also go through this
 
Rakesh Thawait
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for reply.
But my problem is to prevent the user to click button for more than 4 times within a day. After that day user should be again allowed to click the button for 4 times means four clicks a day should be allowed.

Hope this better state my problem.
 
Piotr Kiraga
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
After form submission set a cookie with 3600*24 time of validation and save inside the counter. If it meets the 4 than You will not execute protected actions.

Hope it helps.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!