Advertisement
Virajsinh

validation add bootstrap using validate

Oct 6th, 2021
1,897
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 0.44 KB | None | 0 0
  1. jQuery.validator.setDefaults({
  2.     errorElement: 'span',
  3.     errorPlacement: function (error, element) {
  4.         error.addClass('invalid-feedback');
  5.         element.closest('.form-group').append(error);
  6.     },
  7.     highlight: function (element, errorClass, validClass) {
  8.         $(element).addClass('is-invalid');
  9.     },
  10.     unhighlight: function (element, errorClass, validClass) {
  11.         $(element).removeClass('is-invalid');
  12.     }
  13. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement