The save button gets disabled after you click it once, but if you click it again, it resubmits the form. I am guessing it never reaches the first part of the if statement. Any help would be appreciated:
-block extra_scripts
:javascript
function check_button(){
var saveButtons = $('a[name=saveButton]');
if (saveButtons.is(':disabled')) {
alert("disabled");
return false;
}
else{
$("#main_form").submit();
saveButtons.attr("disabled", true);
}
}
-block main
.btn-group.pull-right
%a.btn.icon-save.btn-callout{
:name => "saveButton",
:id => "saveButton",
:type => "submit",
:onclick => "check_button()"
}
Save
Just a note, saveButtons contains two buttons. One for the top of the page, and one for the bottom.