Menu

#138 FormValidator custom RegExp

open
nobody
Component (61)
5
2009-11-30
2009-11-30
No

Custom regexp in FormValidator does not work. The error is in jsval.js, near line 225.
Original code:
nBegin=0;nEnd=0;
if(regex.charAt(0)=="/")nBegin=1;
if(regex.charAt(regex.length-1)=="/")nEnd=0;
Modified code:
nBegin=0;nEnd=regex.length;
if(regex.charAt(nBegin)=="/")nBegin=+1;
if(regex.charAt(nEnd-1)=="/")nEnd=-1;
The syntax of the slice function at the next line was not correct for strings.

Regards

Discussion


Log in to post a comment.