Forum Moderators: open
function disableSubmit() {
myForm.myButton.value = "Processing...";
myForm.myButton.disabled = true;
return true;
}
...
<FORM onSubmit="return disableSubmit();" ACTION="test.abc" NAME="myForm" METHOD="POST">
...
<INPUT TYPE="SUBMIT" VALUE="Confirm" NAME="myButton"/>
This will make the page post an empty form to the "test.abc" page! It seems to be the line "myForm.myButton.disabled = true;" that causes the empty form posting, because if i use only the "myForm.myButton.value = "Processing...";" line, everything works fine (except of courcse that the button does not get disabled, which is what i wanted!)
I'm using IE 6.0 on W2K.
Clues, anyone?
<input type="submit" value="Submit" onClick="this.disabled=1;this.value='Processing...';">
The form goes to the submit process normally, independent of what has happened to the button's state.
Note that if you are running a form validation routine, you want to re-enable the button if validation fails, to give the user a chance to fix things and re-submit.