Ahh, that could be something. But what about the messages? I can have an unknow number of customer fields in my form and I can't add lets say a hundred messages that looks exactly the same just to be sure. Something similair to addClassRules (addClassMessages?) would be awsome. Is there no other way around it?
/Niklas On Jun 23, 3:16 pm, "Jörn Zaefferer" <[EMAIL PROTECTED]> wrote: > One option would to use addClassRules > (http://docs.jquery.com/Plugins/Validation/Validator/addClassRules#nam...) > to create a composite rule, then apply that class to all customer > fields. You'd still need to provide the messages - you could set it as > the default via $.validator.messages.required = "...". > > Jörn > > On Mon, Jun 23, 2008 at 2:23 PM, badtant <[EMAIL PROTECTED]> wrote: > > > Hi, > > > This post concerns the Validation plugin > >http://bassistance.de/jquery-plugins/jquery-plugin-validation/ > > > I have several input fields that should have the same rules and > > messages. I don't want to specify them over and over again so my > > question is: how can I do that? > > > Here's an example: > > > rules:{ > > customer1:{ > > required:true > > } > > }, > > messages:{ > > customer1:{ > > required:"Välj om du är kund hos Avanza > > eller ej" > > } > > } > > > Now I wan't the same to apply to the names customer2, customer3, > > customer4 and so in. > > > Thanks! > > /Niklas