views:

771

answers:

1

I have a credit application form. If there is a co-applicant, I want to run the same validation for the primary applicant. Currently, I have:

$().ready(function() {
$("#cApp").validate({
 rules: { ... },
 messages: { ... }
});

$('#coApp').click(function() {
 var coAppVal = $('input[name=coApp]').val(); 
 if (coApp == 1) {
        $('#sec_FirstName').rules("add", 
      {
       required:true, 
       messages: { required: " <span style='color:red;'>Please enter co-applicant's first name</span>"
       }
      });  
});

this works. thanks found this link: http://docs.jquery.com/Plugins/Validation/rules#.22add.22rules in case somebody else runs in the same problem

A: 

if you use jquery ,

why you dont use validate plug in ?

http://docs.jquery.com/Plugins/Validation

Haim Evgi
i am using the validate plugin.
FALCONSEYE