RequiredFieldValidator : DropDownList (newbie qu)

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
 
K

Karl Seguin

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

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

Karl
 
G

George Durzi

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

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top