When trying to perform form validation with the type
'word', the regex incorrectly fails unless the input
string is either a single 'word' character or multiple
'word' characters and a space (I have NO idea why it
works when you add a space).
If you change the regex in line 201 of formval.js from
/\W/ to /^\w+$/, it seems to work as intended.
201: if(cons['word'] && !mjs_match(value,/^\w+$/))
Hope this helps,
John F. Zmrotchek
john.zmrotchek@morganstanley.com
Logged In: YES
user_id=1162293
Thanks for issuing this bug report.
Actually, not only the 'word' mode is broken; 'alpha' and
'alnum' are also unfunctional due to a wrong logic in
testing the matching code:
if(cons['word'] && !mjs_match(value,/\W/))
should have been:
if(cons['word'] && mjs_match(value,/\W/))