I have a registration form that uses the javascript validation code I have posted below. I am trying to verify that the user enters a birthdate in the format 01/11/1999
Anyone know how I can incorporate a date format code into my existing code?
Thanks for any help - Jerry
Expand|Select|Wrap|Line Numbers
- <script type="text/javascript">
- <!--
- function validate_form ( )
- {
- valid = true;
- if ( document.registration.firstname.value == "")
- {
- alert ( "Please fill in the 'First Name' box." );
- document.registration.firstname.focus();
- return false;
- }
- if ( document.registration.birthdate.value == "")
- {
- alert ( "Please fill in the 'Birthdate' box." );
- document.registration.birthdate.focus();
- return false;
- }
- return valid;
- }
- //-->
- </script>