At the moment, I am utilizing this script to remove my masks upon submission:
$(".active_validator").submit(function() {
$('.money_mask').unmask();
$('.num_mask_thou').unmask();
$('.zipcode').unmask();
$('.only_numbers').unmask();
});
I have noticed that even if an error occurs during submission, such as a user not completing a field, the masks are still removed.
How can I adjust it so that the masks are only removed on a 'successful' submission rather than any submission?