troubleshooting Question

mutipe rules in form validation

Avatar of promediagrp
promediagrp asked on
jQuery
2 Comments1 Solution310 ViewsLast Modified:
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").validate({
          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
HainKurt
Sr. System Analyst

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros