I'm using jQuery Validation plugin to validate a WordPress theme form. I'm using also Bootstrap 4 so I'd integrate the Bootstrap validation classes ("is-valid" and "is-invalid") with Validation plugin, how can I do?

1 Answer 1


I found this solution:

    highlight: function (element, errorClass, validClass) {
    unhighlight: function (element, errorClass, validClass) {

This is my previous personal solution:

signup_form.on( 'change submit', function( e ) {
    $( '.error' ).removeClass( 'is-valid' ).addClass( 'is-invalid' );
    $( '.valid' ).removeClass( 'is-invalid' ).addClass( 'is-valid' );
} );

Which is better?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.