So I don't know if I am just overlooking a typo but I have the following two buttons on a form
<button id="saveAffidavit "class="btn btn-primary">Save Affidavit</button>
<button id ="submitAffidavit" class="btn btn-primary">Submit Affidavit</button>
Then this is the Javascript
$('#submitAffidavit').click(function(){
console.log("Submit Affidavit Button Clicked");
submitAffidavit();
});
$('#saveAffidavit').click(function(){
console.log("Save Affidavit Button Clicked");
saveAffidavit();
});
function saveAffidavit(){
console.log("Save Affidavit Ran");
document.getElementById('submitType').value = 'Save';
console.log(document.getElementById('submitType').value);
document.getElementById("jpFormInput").submit();
}
function submitAffidavit(){
console.log("Submit Affidavit Ran");
document.getElementById('submitType').value = 'Submit';
console.log(document.getElementById('submitType').value);
document.getElementById("jpFormInput").submit();
}
The .click for 'submitAffidavit' seems to function and successfully calls the submitAffidavit() method.
the .click for 'saveAffidavit' does NOT seem to function at all.. but the form is still submitting when the button is clicked. I do not get any of the console messages printed out.
any ideas are appreciated. thanks
saveAffidavitbutton element id...id ="submitAffidavit"in the button tag. That should beid="submitAffidavit".