diff --git a/docs/en/UI/Blazor/Forms-Validation.md b/docs/en/UI/Blazor/Forms-Validation.md new file mode 100644 index 0000000000..c2531efb84 --- /dev/null +++ b/docs/en/UI/Blazor/Forms-Validation.md @@ -0,0 +1,40 @@ +# Blazor UI: Forms & Validation + +ABP Framework Blazor UI is based on the [Blazorise](https://blazorise.com/docs) and does not have a built-in form validation infrastructure. However, you can use the [Blazorise validation infrastructure](https://blazorise.com/docs/components/validation) to validate your forms. + +## Sample + +_Example provided by official Blazorise documentation._ + +```html + + + + Please enter the name. + Name is good. + Enter valid name! + + + + + + + + Please enter the email. + Email is good. + Enter valid email! + + + +@code{ + void ValidateEmail( ValidatorEventArgs e ) + { + var email = Convert.ToString( e.Value ); + + e.Status = string.IsNullOrEmpty( email ) ? ValidationStatus.None : + email.Contains( "@" ) ? ValidationStatus.Success : ValidationStatus.Error; + } +} +``` + +> Check the [Blazorise documentation](https://blazorise.com/docs/components/validation) for more information and examples. \ No newline at end of file