# Javascript date validation

**URL:** <https://forum.kirupa.com/t/javascript-date-validation/205261>\
**Category:** Uncategorized\
**Created:** [October 27, 2006, 2:43pm UTC](https://forum.kirupa.com/t/javascript-date-validation/205261 "2006-10-27T14:43:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![monkeygirl](https://avatars.discourse-cdn.com/v4/letter/m/bc8723/32.png) [@monkeygirl](https://forum.kirupa.com/u/monkeygirl)\
**Post date:** [October 27, 2006, 2:43pm UTC](https://forum.kirupa.com/t/javascript-date-validation/205261/1 "2006-10-27T14:43:36Z")

</div>

Hello smart people!

I set up a form that acquires d.o.b. information with three separate fields, but I’m not quite sure how to validate them. Please help.

The html part that contains the input fields looks like this:

```auto
Birthday:<br />
<input type="text" name="monthOfBirth" size=2" maxlength="2" value="mm" />&ndash;
<input type="text" name="dayOfBirth" size="2" maxlength="2" value="dd" />&ndash;&nbsp;
19<input type="text" name="yearOfBirth" size="2" maxlength="2" value="yy" /></font></b>

```

so i have three fields:  
one for the month  
one for the day  
and one for the last two #s of the year

How do I use javascript to validate these fields?

I just want to check that the month field is made up of a number from 01 to 12;  
day is from 01 to 31  
year is 00 to 99

Please help!

Thanks!!!
