Have a form which includes a drop down list and a text box for the users to select a time or to enter one manually. I need validation so that if the user enters a time and selects a time from the list or if they don't use either that it will appear as an error. Just wondering what type of validation I would use here?

So based on what i am understanding about your description, the user can either make a selection from a dropdown list or manually input the the information in a textbox. You may want to consider disabling the alternate control. For example, if the user makes a selection from the dropdown list, disable the textbox. If the user clicks in the textbox, disable the dropdown list.

If the user inputs data in the dropdown list, use a RegularExpressionValidator. To use this type of validation, you'll need to be familiar with RegEx.

If you want to keep it as simple as possible and ensure that the data that is submitted is controlled, stick with a dropdown list so there is no manual input.

Be a part of the DaniWeb community

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