Really-Easy-Field-Validation
Really-Easy-Field-Validation copied to clipboard
Validate with notOneOf
How would I proceed if I wanted to use notOneOf? Do I need to add this directly within validation.js or within my template file?
If the code below is the input I want to validate with my custom validate-somethingsomething, how would I need to edit this code?
input type="text" name="billing[email]" id="billing:email" value="htmlEscape($this->getAddress()->getEmail()) ?>" title="__('Email Address') ?>" class="input-text validate-email required-entry"
Something like this:
Validation.addAllThese([ ['validate-somethingsomething', 'bla bla', function(v) { notOneOf : ['this', 'that'] }],
won't work. Thanks
Have a look at the README file, there's a couple of examples in there. Instead of a function you pass an array of options. So instead of
function(v) {
notOneOf : ['this', 'that']
}
you just put
{
notOneOf : ['this', 'that']
}
Thank you so much, it is working now! One more question: Can I use regular expressions in here? I would require something like 'thisisfixed [0-9]'