Improve auto-disable logic for some form buttons

This commit is contained in:
Lance Edgar 2017-11-17 17:27:33 -06:00
parent 455f991857
commit a8c8447297

View file

@ -182,6 +182,9 @@ $(function() {
// https://stackoverflow.com/questions/5691054/disable-submit-button-on-form-submit // https://stackoverflow.com/questions/5691054/disable-submit-button-on-form-submit
$('form.autodisable').submit(function() { $('form.autodisable').submit(function() {
var submit = $(this).find('input[type="submit"]'); var submit = $(this).find('input[type="submit"]');
if (! submit.length) {
submit = $(this).find('button[type="submit"]');
}
if (submit.length) { if (submit.length) {
disable_button(submit); disable_button(submit);
} }