TextBox / Validation

Blazor TextBox - Form Validation

Loading Syncfusion Blazor Server Demos…

This example demonstrates form validation using Data Annotation attributes. Type a value in the input element. If the input value is valid, the input will be ready to submit. Otherwise, an error message will be displayed until you enter a valid value.

The form enables validation with data annotation attributes when the submit button is clicked externally. All validation rules are enforced by the DataAnnotationsValidator component.

Name Field Validation Rules:

Field Rule
Required The field must have a valid value.
MinLength The field must have more than 3 characters in length.
MaxLength The field should not have more than 10 characters in length.

Address Field Validation Rule:

Field Rule
Required The field must have a valid value.
Transform your Blazor web apps today with Syncfusion® Blazor components
145+ high-performance and responsive UI components
Dedicated support
Hassle-free licensing
TRY IT FOR FREE