I have two input fields on my form – I’d like to only allow users to enter field2 if field 1 has valid data. How can I achieve this using jQuery.
Thanks in advance
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.
Here is a demo: http://jsfiddle.net/gL8Jq/
Note that
.on()is new in jQuery 1.7 and in this case is the same as.bind(): http://api.jquery.com/on