Nov 20th, 2013, 5:07 PM
I added a case to the rsv.js but I'm just not getting the regexp right.
The field needs to have just numbers and commas.
These numbers can range from 1-900.
case "digitscommas_only":
if (form[fieldName].value && form[fieldName].value.match(/[\D,]+/))
{
if (!rsv.processError(form[fieldName], errorMessage))
return false;
}
break;
I thought I'd keep it simple with just Digits and comma range, but I'm missing something.
value.match(/[\D,]+/)) is allowing only digits, put a comma in the field and it fails. I tried the unicode variation as well [\D\U+002C]+
I also tried (/[\D\%%C%%]+/)) since the commas are replaced with %%C%% earlier on in the rsv.js, but I believe they are back by this point in the validation function.
[\D,]+ seemed pretty obvious. what am I missing?
The field needs to have just numbers and commas.
These numbers can range from 1-900.
case "digitscommas_only":
if (form[fieldName].value && form[fieldName].value.match(/[\D,]+/))
{
if (!rsv.processError(form[fieldName], errorMessage))
return false;
}
break;
I thought I'd keep it simple with just Digits and comma range, but I'm missing something.
value.match(/[\D,]+/)) is allowing only digits, put a comma in the field and it fails. I tried the unicode variation as well [\D\U+002C]+
I also tried (/[\D\%%C%%]+/)) since the commas are replaced with %%C%% earlier on in the rsv.js, but I believe they are back by this point in the validation function.
[\D,]+ seemed pretty obvious. what am I missing?