I have a form with multiple submit buttons. I simply want to disable them once either is pressed, and everything works fine until I 'disable' them in the .submit() JQuery handler, in which case the form no longer appears to send the button name/value information along with the form. How can I disable the buttons but still have the button name/value submitted so I can determine which one was pressed?
The Form
<form action="myaction" method="post" name="sendgift" id="sendgift" >
....input, etc ....
<input type="submit" name="_action_go" value="Looks great! Do it" id="sendgiftbtn" />
<input type="submit" name="_action_index" value="I need to make changes" id="gobackbtn" />
</form>
The JS:
<script type="text/javascript">
$("#sendgift").submit(function() {
//if I remove these two lines, everything works
$("#sendgiftbtn").attr('disabled', 'disabled');
$("#gobackbtn").attr('disabled', 'disabled');
console.log("disable buttons called");
return true;
});
</script>