|
-
Mar 4th, 2004, 11:01 AM
#1
Thread Starter
Frenzied Member
Javascript problem?
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;
}
}
-
Mar 27th, 2004, 07:33 PM
#2
-
Mar 28th, 2004, 04:26 AM
#3
Code:
/^\d{1,4}\.\d{1,4}\.\d{1,4}$/.test(tempobj.value);
Ensures three groups of digits 1-4 digits each, separated by dots.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|