424,279 Members | 1,905 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,279 IT Pros & Developers. It's quick & easy.

Validations to be considered for writing script for date of birth in a form

P: 29
i need your help for writing javascript for date of birth.in dis we are using seperate drop down menus for date,month and year.....so wat are d validations to b considered 2 overcome dis.......
Mar 31 '07 #1
Share this Question
Share on Google+
4 Replies


Expert 100+
P: 1,892
i need your help for writing javascript for date of birth.in dis we are using seperate drop down menus for date,month and year.....so wat are d validations to b considered 2 overcome dis.......
If you are getting the values from drop downs then you shouldn't have too much too worry about. Dont give them the option for dates that you know possibly couldn't be reasonable like 01/01/1901 unless you have some really old people visiting your page.
Mar 31 '07 #2

P: 29
This is the html code i hav used for the date of birth
now my aim is that when v submit the form the date,month and year fields
should not be empty
can u plz provide me the necessary function
i mean script
thanq






Date of Birth :
<select name="month" autocomplete="off" class="text" id="dateofbirth" >
<option selected="selected">Jan</option>
<option>Feb</option>
<option>Mar</option>
...........................
</select>
<select name="date" autocomplete="off" class="text" id="dateofbirth" >
<option selected="selected">1</option>
<option>2</option><option>3</option>
............................</select>
<select name="year" autocomplete="off" class="text" id="dateofbirth" >
<option selected="selected">1955</option><option>1956</option><option>1957</option>
.....................................
</select>
Mar 31 '07 #3

acoder
Expert Mod 15k+
P: 16,027
This is the html code i hav used for the date of birth
now my aim is that when v submit the form the date,month and year fields
should not be empty
can u plz provide me the necessary function
i mean script
thanq
Check out these tutorials/articles:
Form Validation- Apple
Form Validation - W3Schools
Form Validation - doing it right
Apr 2 '07 #4

acoder
Expert Mod 15k+
P: 16,027
Also check this date validation script.
Apr 2 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.