File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes HTML, CSS and JavaScript and the fly likes Disabling Submit Button Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Customer Requirements for Developers this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Disabling Submit Button" Watch "Disabling Submit Button" New topic

Disabling Submit Button

Kashyap Jani

Joined: Dec 04, 2002
Posts: 1
I have a submit button image which i need to disable once pressed. I can disable an normal image but not the submit button. I'm using the following code to disable the image :
But the above code doesn't work for input type=image button. Is there anyway i can disable the submit button so that the user does not click submit the form twice.
Any help would be appreciated.
Eric Pascarello

Joined: Nov 08, 2001
Posts: 15385
I personally would use an input button
you can use a session cookie with this script too.
Note take the _ out of on_click
var AllowIt=true;
function SubIt(){
alert('This form should only be submitted once');
<form name="formname">
<input type="button" value="submit" name="Button" on_click="subIt()">
I agree. Here's the link:
subject: Disabling Submit Button
It's not a secret anymore!