This script is suppose to check to see if a date is correctly entered. It doesnt work.

Anyone see how to fix it?

PHP Code:
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;
            }
        }