I would like the below function to fire ONLY if element id #submit
is clicked. I was creating another button (back button) and for some reason after my back button was fired, the below code ran regardless... so I need to wrap the below in another condition (only ig #submit is clicked)
submitHandler: function(form) {
var complete = function(){
$('.form-container').find('header').hide();
$(form).fadeOut(function(){
$('#thanks').fadeIn();
});
};
here is the code for the back button -- it runs onclick as supposed to, BUT afterward the 'submit' function above runs. I need the submit above to ONLY run with the submit click not the back click.
//* back button */
document.getElementById('back').addEventListener('click', function () {
jQuery('.step1').show();
jQuery('submit3').hide();
jQuery('#privacyalert').hide();
jQuery('.step2').hide();
jQuery('.step3').hide();
jQuery('#thanks').hide();
jQuery('#back').hide();
}, false);