I have a form with some controls. I didn't use validations in visual studio toolbox, In fact I have defined validations for these controls using java script . one of these validations is Regular Expression .
how to check user's data with this regular expression?
for (i = 0; i < rows.length; i++) {
if (patterns[i] != "") {
val = document.get ElementById ('cntrl'+i).value;
ptrn = patterns[i];
if (!ptrn.test(val)) {
msg += "bad format. \n";
j = false;
}
}
}
I test this code by Firebug, but it exits from second if loop in first time.