= /.{1,}/; // matches at least one character
PatternsDict.numberPat = /\d/; // matches numbers only
PatternsDict.pwPat = /^\D{1}\S{3,9}$/; // matches between 4 and 10 characters with non-digit leading
PatternsDict.currencyPat = /\$\d{1,3}(,\d{3})*\.\d{2}/; // matches currency with commas
PatternsDict.timePat = /^([1-9]|1[0-2]):[0-5]\d$/; // matches times
var elArr = objForm.elements;
for(var i=0; i<elArr.length; i++)
with(elArr[i]) {
var v = elArr[i].VALIDATOR;
if(!v) continue;
var thePat = PatternsDict[v];
var gotIt = thePat.exec(value);
if(!gotIt) {
var returnStr;
readName = replace(name, "_", " ");
returnStr = "The " + readName + " field is invalid, this field is required in order to submit this form. Please try again!";
alert(returnStr);
return false;
}
}
return true;
}