Smart Textbox Date Mask and ASP.NET
Posted on 2005-04-13
I've scoured the Web, figuring this would be a common question, but I cannot find a solution...so if your answer is a link that provides everything I need, great!
Here are the requirements:
1. Must only allow numeric and "/"
2. Must be in the format mm/dd/yyyy
3. Must be "smart" enough to advance from mm to dd if 2 thru 9 entered
4. Must insert "/" in the appropriate places as the user types
5. Must insert trailing zeros if not entered (ex., if the first character entered is 2 then the script will, probably on keydown, return "02/" to the textbox)
6. Must not exhibit strange behavior if the user is editing numbers within the string (like disallowing entry if editing the day and will still allow the slash)
The point value is based on the fact that I would like a complete solution and not just bits and pieces.