Blazor Numeric TextBox - Form Validation
This example is used to validate form using the Data Annotation. Type the number in the input element. If the input value is a valid number, then the given input will be ready to submit. Otherwise, an error message will be shown until you enter the valid number.
The form enables the validation with data annotation attributes by clicking on the submit externally. All rules are validated by the DataAnnotationsValidator.
The above age field is configured with the following rules.
Field | Rule |
---|---|
Required | The field must have a valid number. |
Range | The field must have a number value between 1 and 80. |