promediagrp
asked on
mutipe rules in form validation
Hi
I'm using jquery.validate.js . I have the following code in the head
<script type="text/javascript">
$.metadata.setType("attr", "validate");
$(document).ready(function (){
$("#subscriptionForm").val idate({
rules: {
cemail: "required email",
cemail_again: {
equalTo: "#cemail" ,
cpassword: "required password",
cpassword_again: {
equalTo: "#cpassword"
}
}
}
});
});
</script>
If I place more than one rule in this code, only one part works, (i,e., the form will check that the two email fields match, or that the 2 passwords match, not both sets. So, if I omit the password code, the email works fine, and visa versa. Can anyone help? Here is a link to the form, http://www.districtadministration.com/layouts/subscriptions/print_subscribe.html
Thank you in advance,
Sharon
I'm using jquery.validate.js . I have the following code in the head
<script type="text/javascript">
$.metadata.setType("attr",
$(document).ready(function
$("#subscriptionForm").val
rules: {
cemail: "required email",
cemail_again: {
equalTo: "#cemail" ,
cpassword: "required password",
cpassword_again: {
equalTo: "#cpassword"
}
}
}
});
});
</script>
If I place more than one rule in this code, only one part works, (i,e., the form will check that the two email fields match, or that the 2 passwords match, not both sets. So, if I omit the password code, the email works fine, and visa versa. Can anyone help? Here is a link to the form, http://www.districtadministration.com/layouts/subscriptions/print_subscribe.html
Thank you in advance,
Sharon
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER