Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can a double-click or multi-click of a submit button be forced as ONE submit click ?

 
Mallika Kumar
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have an interface where a user enters some information into text fields, and queries on them. Every submit button click is a hit to the database, where the query is executed, and its results are displayed. Sometimes, by mistake, the user hits submit button twice, so two database hits occur, wherein, it should be only one database hit. Can I force multiple submit button hits as one submit button hit ? I'm using JSP/Java Beans/EJB tiers. In my JSP tier, can I force this functionality ?
Any response will be appreciated.
Thanks.
 
Adam Hardy
Ranch Hand
Posts: 567
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think there's anything you can do server-side, but you could put some javascript in the page. this is what i do - i set the onsubmit event of the form element to the function with
onsubmit="return trySubmit();";

 
amit ang
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
What i think is at the max u can call the javascript function and get the confirmation fro the client and disable the button.
Amit
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic