I have a form that is passing data to a cc processing terminal, as well as writing PDF contracts and receipts. There is validation built into the form, and I am trying to ad
In your submit button code just add javascript code:
<input type="submit" [...] id="btn1" onclick="setTimeout(disableFunction, 1);">
and in Javascript add function:
function disableFunction() {
document.getElementById("btn1").disabled = 'true';
}
You can you if you are using jQuery form validator
$(document).ready(function () {
$("#addOfficerForm").submit(function () {
var total_error = document.querySelectorAll('.error').length;
if(total_error === 0){
document.getElementById("checkEditRestriction").disabled = 'true';
}
});
});