How can I check whether the form validation is successful with parsleyjs without clicking any button? I want to make a button active if the form is validated.
(function creditCardFields() {
$('#creditCardForm').parsley();
$('#creditCardForm').submit(function (event) {
$(this).parsley().validate();
if ($(this).parsley().isValid()) {
$('.next-step').removeClass('disabled');
console.log('valid');
}
event.preventDefault();
});
})();
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>