RequiredFieldValidator : DropDownList (newbie qu)

  • Thread starter Thread starter Angela
  • Start date Start date
A

Angela

Hi

I am trying to validate a dropdown with RequiredFieldValidator.

One of the list items is 'Please select' with a value of 0.

How can I validate whether they have selected this option?

Thanks

Angela
 
You can use the InitialValue property to validate against this value.

<asp:req... InitialValue="0" /> will fail if "Please Select" is the
active.

Karl
 
Make it's value an empty string.

The REquiredFieldValidator will then work on it just like if it was any
other HTML control
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top