RequiredFieldValidator and DropDownList intial value

The RequiredFieldValidator complains if the value of the dropdown list is unchanged even though you may have some default value set programmatically.

To solve this, set InitialValue to the required field validator.

If you set a default value to a dropdown list and then disable the dropdown list, the validator will not work correctly. Use a hidden field and use javascript to update it every time the dropdown list’s value is changed, then configure the validator to check the hidden field instead.

Leave a Reply

Your email address will not be published. Required fields are marked *