Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript_howto thread: Text box and date


Message #1 by "Paulo Fernandes" <paulofernandes@c...> on Tue, 11 Feb 2003 20:59:58 -0000
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






  Return to Index