mirror of https://github.com/snachodog/mybuddy.git
♻️ changes the way to prevent double form submission
Instead of disabling form submit buttons, which values were lost in the process, attach a new handler which disabled form submission until first submission is processed
This commit is contained in:
parent
dd016cb1ea
commit
e6107b6f3d
|
@ -75,6 +75,10 @@ BabyBuddy.PullToRefresh = function(ptr) {
|
|||
/**
|
||||
* Fix for duplicate form submission from double pressing submit
|
||||
*/
|
||||
function preventDoubleSubmit() {
|
||||
return false;
|
||||
}
|
||||
$('form').off("submit", preventDoubleSubmit);
|
||||
$("form").on("submit", function() {
|
||||
$(this).find("button[type='submit']").prop('disabled', true);
|
||||
});
|
||||
$(this).on("submit", preventDoubleSubmit);
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue