Use a regular expression:
if(textBox.value.search(/^\d{2}[-]\d{2}[-]\d{4}$/) !=3D -1){
// The textBox's value is ok
}
/Robert
-----Original Message-----
From: Paulo Fernandes [mailto:paulofernandes@c...]
Sent: den 11 februari 2003 22:00
To: JavaScript HowTo
Subject: [javascript_howto] Text box and date
I need to validate a text box in a form on the submit event.
It has to have the following format: "dd-mm-yyyy"
I know how to do this using ASP but I wanted to do it client-side...
Can anyone help me with a code example?
Thanks !
PauloF