aspose file tools
The moose likes HTML, CSS and JavaScript and the fly likes disabling submit button Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Practical Unit Testing with TestNG and Mockito this week in the Testing forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply Bookmark "disabling submit button" Watch "disabling submit button" New topic
Author

disabling submit button

Sarran Vidyakumar
Greenhorn

Joined: Mar 26, 2003
Posts: 28
Hey:
i need to disable the submit button so it cannot be clicked multiple times.. i have managed to disable the button using javascript but dont see the required results coz the servlets that the html page calls does a check, sumthing like if(submitButton != null)..but in out case the button has been disabled and hence control doent go into the loop..any suggestion to fix it..Thanks
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15003
easiest things is to disable the button after it was clicked...
e.g.
<input type="submit onclick="this.disabled=true;">
or you can try to hide it and see if that works....
this.display=none;
most people use a javascript code instead of the submit button
<input type="button" name="b" @#111;nclick="SubForm()">
then the script

see if that helps
Eric
[ March 11, 2004: Message edited by: Eric Pascarello ]
Yuriy Fuksenko
Ranch Hand

Joined: Feb 02, 2001
Posts: 411
I would suggest to add something like
setTimeout("allowSubmit=true",5000)
into the if statement - in case user hits stop button
 
 
subject: disabling submit button
 
Threads others viewed
disallow form submission on multiple clicks
disable the submit button after clicking
Disabling form elements on a table row
Disabling Submit Button
Handling double submission in Struts 2
developer file tools