Click here to Skip to main content
15,890,186 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hi,
I need Date of Bitrh in mm/dd/yyyy format in three textboxes.In first textbox user can only enter Month in second user can only enter Date and in last textbox use can only enter Year.when user enter month he will navigate to date textbox after filling date user automatically go to year textbox.
Thanks
Naveen Sharma
Posted
Updated 26-Jul-12 20:54pm
v3

I don't think solving all that problems (however simple) worth the effort, as you can always use much more adequate DateTimePicker. Please see:
http://weblogs.asp.net/hajan/archive/2010/07/15/integration-of-jquery-datetimepicker-in-asp-net-website-part-1.aspx[^].

—SA
 
Share this answer
 
Comments
Rohit from Delhi 27-Jul-12 1:27am    
thanks for your response solution.but as per my problem client only want date of birth in 3 textboxes nothing else.
Thanks,
Naveen Sharma
Sergey Alexandrovich Kryukov 27-Jul-12 1:32am    
If you will listen to your client "requirements" too much, you risk not developing anything working at all. One of the difficult part of software development is making people to accept your suggestions/decisions. Without this, no development is possible.
--SA
Rohit from Delhi 27-Jul-12 1:38am    
thanks now i will definitely talk with client.
Sergey Alexandrovich Kryukov 27-Jul-12 16:38pm    
I'm so glad you take it so constructively. It's never easy but important and should ultimately help. It's less difficult if you have a positive sample which can look convincing to the client, which could be well the case with the DateTimePicker.
--SA
Abhinav S 27-Jul-12 1:28am    
Good suggestion. 5!
Just catch the Blur event for the three textboxes and check that the values are valid within each of the three boxes.

E.g.
JavaScript
<input type="text" id="1" value="test" onBlur="javascript:Validate()();">
function Validate(){
 if text > 31 {alert (Invalid Date);}.
}

You will need to handle leap year validaation and month validations as well (30, 31 days etc).
So it might be useful to use something like http://www.the-art-of-web.com/javascript/validate-date/[^]. You can do this when all the three date elements have been entered.
 
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