This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Disabling form submission in IE and Firefox Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Disabling form submission in IE and Firefox" Watch "Disabling form submission in IE and Firefox" New topic
Author

Disabling form submission in IE and Firefox

Tony Ennis
Ranch Hand

Joined: May 22, 2003
Posts: 86
Typical situation. I have a form. I don't want the submit button to be clicked more than once. So I'm disabling the button in a javascript method as per normal.

My problem is that it only works in FF. The button is disabled then the form submits. In IE, the button is disabled but the form does not submit.



jsp:




How can I make this work in both FF and IE?
Tony Ennis
Ranch Hand

Joined: May 22, 2003
Posts: 86
Of course I always get an idea once I post a question.

What I did was make the button always be disabled, and make the form *never* submit. Then I added an explicit form submission.

Apparently in IE if the button is disabled the form submission is canceled and in FF it isn't.



And add a return to the onclick for good measure:


 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Disabling form submission in IE and Firefox
 
Similar Threads
how to disable onclick event
How to perform operations like insert,delete,add,move next etc in jsp page?
onclick="this.disabled=true;"
Multiple Actions issue in JSF
Prevent multiple submits (e.g. double clicks) in a4j:CommandLink