I found this solution:
$.validator.setDefaults({
highlight: function (element, errorClass, validClass) {
$(element).addClass('is-invalid');
},
unhighlight: function (element, errorClass, validClass) {
$(element).removeClass('is-invalid');
}
});
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?
Related Posts:
- bootstrap 3 navbar collapse button not working
- How to center image in carousel
- Can Twitter Bootstrap alerts fade in as well as out?
- Twitter Bootstrap Modal Form Submit
- Twitter Bootstrap Use Collapse in Custom Post Type
- jQuery Validate wp_editor
- Gravity list field override and adding javascript [closed]
- Required radio button does not validate in form, when clicked through Javascript/jQuery
- WP Media Uploader modal conflicts with Bootstrap modal
- change the icon of a custom post type in WordPress to use twitter boostrap
- jQuery Live Form Validation in WordPress
- Bootstrap Dropdown menu is not working
- Email validation using jQuery
- JavaScript Loading Screen while page loads
- Bootstrap Dropdown menu is not working
- Bootstrap Dropdown menu is not working
- Click button copy to clipboard
- How to make html table vertically scrollable
- TypeError: $(…).modal is not a function with bootstrap Modal
- How to make Bootstrap carousel slider use mobile left/right swipe
- Bootstrap throws Uncaught Error: Bootstrap’s JavaScript requires jQuery
- Bootstrap carousel not sliding
- Bootstrap collapse isn’t working; hamburger menu not showing up
- Clear form fields with jQuery
- Check if inputs are empty using jQuery
- Random background images CSS3
- Get a form action/url with jquery
- How do I remove a box-shadow effect from an element when another element is hovered?
- Slide right to left?
- Validate form before submit jquery
- WordPress AJAX File Upload – FrontEnd
- Require featured image
- Automatically decrease font size for long words
- jQuery and AJAX Not working with Select Form Element
- Add X meta box inputs based on form at top of meta box, how to do it right?
- Best approach for loading a sidebar Only if the screen max-width is >900px?
- Stylizing external SVG files with jQuery and CSS
- Comment form vaildation
- Creating custom AJAX requests
- Registration e-mail check with AJAX
- How to properly add Bootstrap and JQuery Javascripts?
- Gravity Forms not loading under https, jQuery is not defined
- validate a metabox based on the category that is selected
- How to use Bootstrap with WP’s jQuery? [closed]
- Accept AJAX call with serialized form data
- Making the wordpress login form a jQuery dropdown
- Cannot prefill hidden Ninja Forms fields
- Add a class to posts in increments of 2
- How can I make this custom menu work?
- Remove WordPress scripts
- Will the latest Bootstrap work properly with the default WordPress jQuery?
- How to make an WordPress element sticky? [closed]
- Accordion scrolls page too low after clicking on the title [closed]
- How to Dynamically Load Content Into Body of Bootstrap Modal Window?
- Using bootstrap-slider and bootstrap-switch in wordpress admin panel
- Frontend Post with JQuery AJAX to Php Issue
- WordPress Multiple Navigation bars
- show/hide div with simple jQuery script [closed]
- Validating a cloned/repeatable input (jQuery) [closed]
- Using Bootstrap Switch with WordPress
- Google yolo one tab signup plugin avilable in wordpress? [closed]
- What is the propre way to include jQuery UI Datepicker’s CSS in plugin?
- Ajax form submit not working, returns 0
- Ajax Validation for reCaptcha
- Superfish Menu Not Loading
- Problem Implementing parallax in header of bp-default theme
- jQuery will not work on page from snippet or file
- JQuery Counter Limit not working for WP Comment Textarea
- jQuery plugin not loading
- Bootstrap modal with jQuery post [closed]
- Duplicate “default” form with jQuery
- Recommended Use of Bootstrap, or JQuery-UI in WP/plugin development?
- Is it OK combined wp-include js, jquery, css? [closed]
- Converting a working AJAX form to work with WordPress
- Bootstrap and jQuery error: $ is not defined
- How to setup multi-page using jquery?
- Is textarea always accesible throught textarea#content in wordpress dashboard for a specific page?
- Auto next upon clicking image without clicking Next button
- How can I get this menu container to be the height of the contents?
- Getting click on item to open closest relevant element (popup) with jQuery
- Form validation before submitting
- jQuery for Fade Preload Causes My Site Favicon to Disappear from Tab of Browser
- jQuery function not working in WordPress but works in jsfiddle
- Site images are fixed in front of my site content [closed]
- Is not using admin-ajax to ajax submissions okay?
- Bootstrap with separate js File
- $_POST empty in using new php file added to theme
- value not saving in the form when dynamically creating an input
- All post attachments in gallery grid to full screen slideshow?
- :first-child applying to all links [closed]
- How to update scrollbar when using Jetpack’s Inifnite Scroller?
- Customize wp-admin form custom fields
- Auto Select Child categories on Multiple Dropdown – Jquery
- Hide input field when second input field is in focus
- jQuery form plugin, submit in the wordpress way
- Contact Form 7 checkbox to add a new class to a div [closed]
- jQuery color picker function on change
- How do I add Javascript and CSS files into WordPress?
- can’t make jQuery work (change image on time interval) [closed]
- Elementor form – checkboxes validation