I have two password fields
pwd1 and pwd2
I am using jquery plugin http://bassistance.de/jquery-plugins/jquery-plugin-validation/
How to make pwd1 and pwd2 to be required and equal if and only if any one of the field is non-empty ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use an
equalTorule, as @voigtan suggests, but store therequiredrule in the element’s class. That will allow you to enable or disable the rule at will:You can test it in this fiddle.