Dear sir

I have a page that is a input form. I need to check the date field format. How can i write a script to check it ?
For example
the format is YYYYMMDD, if i try 11111111. it will send the input error.

Thanks
Mic