I have a single form that, depending on which radio button is clicked (Login or Signup), displays either:
or:
Or you can use the depends property.
http://jqueryvalidation.org/category/plugin/ search for depends
Example: Specifies a contact element as required and as email address, the latter depending on a checkbox being checked for contact via email.
$(".selector").validate({
rules: {
contact: {
required: true,
email: {
depends: function(element) {
return $("#contactform_email:checked")
}
}
}
}
});