Merge pull request #1746 from abastardi/disable-submit
Fix submit button disable bug
This commit is contained in:
@@ -265,13 +265,17 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
/* help preventing double form submission for normal form (not LOADed) */
|
/* help preventing double form submission for normal form (not LOADed) */
|
||||||
$(doc).on('submit', 'form', function () {
|
$(doc).on('submit', 'form', function (e) {
|
||||||
var submit_button = $(this).find(web2py.formInputClickSelector);
|
var submit_buttons = $(this).find(web2py.formInputClickSelector);
|
||||||
web2py.disableElement(submit_button);
|
submit_buttons.each(function() {
|
||||||
|
web2py.disableElement($(this));
|
||||||
|
})
|
||||||
/* safeguard in case the form doesn't trigger a refresh,
|
/* safeguard in case the form doesn't trigger a refresh,
|
||||||
see https://github.com/web2py/web2py/issues/1100 */
|
see https://github.com/web2py/web2py/issues/1100 */
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
web2py.enableElement(submit_button);
|
submit_buttons.each(function() {
|
||||||
|
web2py.enableElement($(this));
|
||||||
|
});
|
||||||
}, 5000);
|
}, 5000);
|
||||||
});
|
});
|
||||||
doc.ajaxSuccess(function (e, xhr) {
|
doc.ajaxSuccess(function (e, xhr) {
|
||||||
|
|||||||
Reference in New Issue
Block a user