Click here to Skip to main content
15,939,620 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have 3 dropdownlists..In DDL1 i insert days(31) in DDL2 i insert months(till Dec) and in DDL3 i insert Years(from 1985 to 2000). suppose if user select date,month and year then automatically age in a below textbox appears. like for 1,Jan,1985 age appears in textbox as 28 years ? how can i do it .
Previously i used calendar control but that was not succesful. please guide me. Thanks.
Posted

Try this plugin.
http://www.datejs.com/[^]

Hope this helps
 
Share this answer
 
Comments
Thanks7872 20-Jun-13 2:06am    
Excellent..! ↑voted.
Rambo_Raja 20-Jun-13 3:09am    
please i m not getting it...thanks for help it help me but not able to solve my problem..as when in ddl1 i select 23 in ddl2 in select feb and in ddl3 i select 1989 then automatically in txtAge calculated age appears as in this particular ex 24. also my big doubt is on selecting the values from different DDL's how they know that they are connected to each other. or say how to connect then here a one more point i m not binding DDL to Datasource. Thanks.Help me .
Thanks7872 20-Jun-13 4:52am    
Refer to chintan's answer below.

There pass year ddl's value as first parameter,month as second and day as third.

DateTime dob = new DateTime(ddlyear.SelectedValue,ddlmonth.SelectedValue,ddldate.SelectedValue);
Jameel VM 20-Jun-13 3:16am    
connected to each other mean? can you explain your requirement?
This one is the best example for calculate the age from given full date. I think its helping to you.

DateTime dob = new DateTime(1988, 10, 23);
TimeSpan tm = (DateTime.Now - dob);
int age = (tm.Days / 365);
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900