Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date/Time Formatted Input

Status
Not open for further replies.

dcusick

Technical User
Aug 9, 2000
271
US
Hello all... I have built a web app in C# that takes in a lot of input from the user. A bunch of the fields are date fields. I have set up a custom-function validater for the fields, to check for valid input. Valid input is MM/DD/YYYY. The users decided that they can't be bothered by typing in 0's or the /'s, within the date. They don't want to use a Calendar control either... hrmm....

I have been thinking here, and don't really know of any way to do this. If a user inputs 3305, how am I supposed to validate that to 03/03/2005? I guess my only possible solution is to write a Custom Control that only accepts certain input. Does anyone else have any other ideas? If the custom control is the way to go, is there any websites that can point me in the right direction? Thanks in advance!
 
Sounds like the users are lazy. Don't understand why they wouldn't want a calendar control. First you will have to set up some common input criteria. Like you said if they type 3305 will that be the same as 030305? They can't just be able to enter what ever they want.
The only thing I can suggest, would be to use a third party control. I have used Infragistics for just this problem. They have a DateTime edit control that shows the "/" but doesn't require the user to type them in. Check them out at Unfortunaltey these are not free controls. You may be able to find something out there.
 
Lazy is right! 3305 is the same as 030305, is the same as 30305, is the same as 332005, etc. which is basically impossible to validate in Javascript. I built this the best I could, and now I have them complaining... oh well... Guess that's what you get for dealing with customers! lol...

I will be sure to check out that website. Hopefully that'll have a solution for me. Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top