Really-Easy-Field-Validation icon indicating copy to clipboard operation
Really-Easy-Field-Validation copied to clipboard

Validate with notOneOf

Open sasoriza opened this issue 13 years ago • 2 comments

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

sasoriza avatar Nov 21 '12 15:11 sasoriza

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']
}

atetlaw avatar Nov 22 '12 08:11 atetlaw

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]'

sasoriza avatar Nov 22 '12 10:11 sasoriza