I have been using jQuery for a couple months and have been looking to
use it as a common library for all my company's applications. I have
also been evaluating the form validator plugin. I am trying to replace
the JS validation library we have now with it. However, I can't figure
out how to set rules for an array of fields with a common class name.

For example, currently, we may collect 3 different phone numbers on
different pages (or even on the same page), so we give each of the
inputs a class of "phone" and on a common js file we will define what
a valid phone number format is, error messages, etc. I can't seem to
find a way to do that easily within the form validation plugin. Every
method I have seen to define rules and messages is done by id or
inline in the class attribute. I am looking for something a little
more global so I don't have to define rules for every phone number/
address/date/etc we are collecting.

I appreciate any help you may be willing to offer. Thank you.

Reply via email to