Tuesday, June 24, 2008

Required Field Validator for DropDownList

You can use RequiredFieldValidator for DropDownList.

Just select InitialValue of the RequiredFieldValidator to -1 or 0 whatever that you select for the first element (often with text "Please Select") of DropDownList. Now validator will work and you need to select any other value than the InitialValue in order to pass validation.

No comments: