Hello All, i want to know that can we create two instance of same validator method in one js??
now let me tell u what i want exact
i have two pages basic.php
another is contact.php
having forms, name is basicForm
and contactForm
respectively , now i want to include one extrenal JS (validForm.js
) file where i want to put both forms validator definations, but unable to succeed.
like
validForm.js
var validator = jQuery("#basicForm").validate({
some rules...
});
var validator = jQuery("#contactForm").validate({
other rules...
});
so i want to know
- may i invoke two instance of var validator in same js? or
- do i have to use different js( having validator method) for different pages?