I want to prevent multiple submit if someone click on one of the submit buttons multiple times.
How can unbind or undelgate in this case th
If you have users who insist on having an active submit button all the time you can use a variable to track the progress. Something like this:
saving_record = 0; //set variable to show if form is in submission
$(document).ready(function () {
$('#form').on('submit', function (e) {
if (saving_record === 0) { //If not submitted yet, submit form
saving_record = 1; //Set variable to show form is in submission
$.ajax({
success: function (data) {
saving_record = 0; //Reset variable to allow record update
},
error: function (data) {
saving_record = 0; //Reset variable to allow record update in case of error
}
})
}
});
});