victorjonsson / jQuery-Form-Validator

[DISCONTINUED] jQuery plugin that makes it easy to validate user input while keeping your HTML markup clean from javascript code.
972 stars 476 forks source link

Form Submitting even after there's validation error in Custom Regex validation #709

Open anupgupta92 opened 6 years ago

anupgupta92 commented 6 years ago

I had registration form where the validation message is being shown but I can still submit the form. it should prevent me from doing it.

<input type="password" name="password_confirmation" id="password_confirmation" 
  data-validation="required custom"
  data-validation-regexp="^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[~!@#$%^&*()_+])[A-Za-z\d~!@#$%^&*()_+]{6,}" 
  data-validation-error-msg-required="Password required"
  data-validation-error-msg-custom="Password must contain:<ul><li>Minimum 6 characters <li>At least 1 uppercase letter <li>At least 1 lowercase letter <li>At least 1 special character <li>At least 1 number</ul>">

Other validations are working like "Required or email" but custom validation is not functioning. Do I need to add some additional module to make this function.

victorjonsson commented 6 years ago

This works for me: http://jsbin.com/xucacagevi/edit?html,output

What version of jQuery are you using? (plugin only compatible up to 2.2.4)