[jQuery] Re: validation plugin: how to add custom messages for groups

2009-01-30 Thread Mihai Danila
Sorry, the third validator must only get "activated" if both are empty (in other words, it must return true if either is not empty): function validateNameInputs(value, element) { return firstNameInput.value || lastNameInput.value; } On Jan 30, 11:19 am, Mihai Danila wrote: > There was a small

[jQuery] Re: validation plugin: how to add custom messages for groups

2009-01-30 Thread Mihai Danila
There was a small typo in validateLastNameInput. Here's the corrected code. jQuery.validator.addMethod('first-name-input', validateFirstNameInput, 'First name is missing.'); jQuery.validator.addMethod('last-name-input', validateLastNameInput, 'Last name is missing.'); jQuery.validator.addMetho

[jQuery] Re: validation plugin: how to add custom messages for groups

2009-01-30 Thread Mihai Danila
I think you can put three validators on the fields, with jQuery.validator.addMethod. I don't know if you can add multiple validators for the same CSS class, so I'm putting extra CSS classes on the inputs: jQuery.validator.addMethod('first-name-input', validateFirstNameInput, 'First name is mis