PDA

Click to See Complete Forum and Search --> : Javascript problem?


Evan
Mar 4th, 2004, 10:01 AM
This script is suppose to check to see if a date is correctly entered. It doesnt work.

Anyone see how to fix it?

if (tempobj.name.substring(0,7)=="reqdate") {
if (tempobj.type=='text') {
var splitted = tempobj.value.match("/\[\d{1,4}\.\d{1,4}\.\d{1,4}\]$/");
if(splitted == null) {
pass=false;
}
break;
}
}

alex_read
Mar 27th, 2004, 06:33 PM
Try looking here: http://www.intranetjournal.com/ix/msg/40084.html

CornedBee
Mar 28th, 2004, 03:26 AM
/^\d{1,4}\.\d{1,4}\.\d{1,4}$/.test(tempobj.value);
Ensures three groups of digits 1-4 digits each, separated by dots.