I am trying to test for a comma delimited set of numeric values
This is supposed to work, but it doesn't seem to.
It allows "11,aa", as well as "12,aa,23".
if ($(this).val() != "") {
debugger;
var intRegex = /^[0-9]+(,[0-9]+)*,?/;
if (!intRegex.test(value)) {
alert("Field must be comma delimited numeric value.");
setFocus($(this));
}
}
Am I missing something in how javascript handles regular expressions?
Thanks,
Tom
This is supposed to work, but it doesn't seem to.
It allows "11,aa", as well as "12,aa,23".
if ($(this).val() != "") {
debugger;
var intRegex = /^[0-9]+(,[0-9]+)*,?/;
if (!intRegex.test(value)) {
alert("Field must be comma delimited numeric value.");
setFocus($(this));
}
}
Am I missing something in how javascript handles regular expressions?
Thanks,
Tom