I wrote this function to disabled submit/reset buttons on a form upon submission (so that they can’t resend the data in the middle of processing it).
[code=php]function formButtonsDisableOnSubmit() {
var forms=document.getElementsByTagName(“FORM”);
for(var i=0; i<forms.length; i++) {
forms[i].onsubmit=function() {
var inputs=this.getElementsByTagName(“INPUT”);
for(var ii=0; ii<inputs.length; ii++) {
if(inputs[ii].type == “submit” || inputs[ii].type == “reset”) {
inputs[ii].disabled=true;
}
}
}
}
}
However, when I disabled the submit buttons it does not pass their values to the next page (a PHP page). Because of this, it doesn’t work when I have multiple SUBMIT buttons in a form. I need to be able to check which submit button was pushed via PHP, but since no values are passed for the button, I can’t. Any ideas?