im using a jquery validation plugin first i add the validation to the form:
$('#EmployeeForm').validate({
rules: {
"Employee.FirstName": "required",
"Employee.PatronymicName": "required",
"Employee.LastName": "required",
"Employee.BirthDay": { required: true, date: true }
},
messages: {
"Employee.FirstName": { required: "*" },
"Employee.PatronymicName": { required: "*" },
"Employee.LastName": { required: "*" },
"Employee.BirthDay": { required: "*", date: "00.00.00 format" }
}
});
and then latter a need to add validation rules to other form elements:
$('#Address_A.Phone1, #Address_A.Phone2, #Address_B.Phone1, #Address_B.Phone2').rules("add", {
digits: true,
messages: {
digits: "?????? ?????"
}
});
but i get an error: 'form' is null or not an object
i check, the form and all the elements in it are created before i add validation to it.
cant figer out whats wrong.