Blazor Dropdown List Example - Form Validation
This sample demonstrates how to use DropDown List inside EditForm
and validate using Data Annotations
. Click Submit button to validate the Form.
In this demo, EditForm
validates all data annotation rules using DataAnnotationsValidator
.
Choose the value from the dropdown popup and if the value is valid, then the given input will be ready to submit.
Otherwise, an error message will be shown until you choose the valid value.
In this demo, the field mapped to the DropDownList Value is configured with the following rule.
Field | Rule |
---|---|
Required | The field must have a valid value. |