Link to home
Start Free TrialLog in
Avatar of promediagrp
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").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
Avatar of HainKurt
HainKurt
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of promediagrp
promediagrp

ASKER

Thank you very much. That was quick and easy.