Namnai Kidorkar,
The script I posted should work for you.
If you are validating a form field all you need to do is:
return document.FormName.ElementName.isValidDate();
Ko Ko Naing,
Using prototype in JavaScript is rather handy. It allows you to create your own methods. I think it is a lot cleaner to code like that. You can develop an oo with JavaScript by using prototypes and classes. Not to advertise, but if you were to pick up Ajax in action, we first develop the code in a straight foward linear approach, then we go back and refactor the code for an oo approach. Makes it so much easier to reuse code on every page. A lot of novices to JavaScript does not know this exists.
You can read about prototype here if you are interested:
http://www.webreference.com/js/column34/index.html A group of use on another forum started to build a large list of prototype functions. I think we are at 70+. My screen name there is A1ien51.
http://webdeveloper.com/forum/showthread.php?t=61883 I have a few scripts there to convert times, calc business days, and much more.
If you want to continue talking about prototypes of oo JavaScript, start a new
thread.
Eric