Search code examples
asp.netvalidationrequiredfieldvalidator

Using Required Field Validator to Disable ListBox


Pretty simple question.

I have a few ASP RequiredFieldValdators checking some text boxes.

Out of the box, it checks validation when a button is pressed, basically disabling it unless all fields are met.

I also have a listbox with a bunch of data points, which load new data into the text boxes that are being validated.

I want to make sure the user can't switch data points before all required fields are met. How can I "disable" the listbox (via validation) similar to how the buttons are "disabled"

Please feel free to ask for clarification


Solution

  • I just set CauseValidation="true" for the listbox. This prevented me from changing data points when the current fields were invalid

    Thanks all