AddRule Pattern ignoring input
- jdan1131x
- Member | 41
problem:
$form->addText(‘username’,‘Username:’,20,50) //col/len
->setRequired(‘Please enter user name’)
->addRule($form::MIN_LENGTH, “Names must be at least %d
characters”,6)
->addRule($form::MAX_LENGTH, “Max name length exceeded”,50)
->addRule($form::PATTERN,“a-z”,‘false’);
repeatability:
i have tried this with a-z, [a-z] [a-zA-Z0–9] [a-zA-Z0–9]+ [a-z]+
[a-z]{6,50} ← THESE
in every event the javascript dialog pops up and shows me one of these and wont
let me register.
i also tried with single quotes, to no avail…
undesired fix:
without the Pattern rule line, registration and login work perfectly and entries
are in user DB.
any assistance much appreciated to get this pattern validator rule to
work. fyi.
testdata:
i was testing with username = jamesdan and password = kljhyt. very simple.
should work…
James