Hi all I m making a project in which i have two textboxes to enter time of Departure and Arrival. The User can enter any string value in a textBox. But i want that user must enter a time format value with am/pm. Is there any component or coding for doing that. Plz guide me. Its urgent

Recommended Answers

All 4 Replies

Might want to use ajax with a pop up date time picker and a read only textbox. This way, you can be sure to have a consistent display and parsing of the value.

Depends if its asp or a windows app, if its an app then you could try parsing the text to a time if that fails tell them its not a valid time.

Good catch lizr, forgot I was in c# rather than asp.net forum.

Hi, Why dont consider the MaskedTextBox control ?. This MaskedTextBox gets formatted input from the user

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.