I have an Ajax-Loader (".ajax-loader") that is only visible if my (contact 7) form checks the form for errors. In this moment i want to remove the class="submit-active" from the submit button:
jQuery(document).ready(function($) {
$('.wpcf7-form .wpcf7-submit').addClass("submit-active");
$(".wpcf7-submit").click(function() {
if ($('.wpcf7-form .ajax-loader').css('visibility') == 'hidden') {
$('.wpcf7-form .wpcf7-submit').removeClass("submit-active");
}
});
});
This works. The only problem now is: How di I add the class "submit-active" to the submit button again after ".ajax-loader" is hidden again?