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
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
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
3 matches
Mail list logo