From cc3e03551ba83d85ecb4bf2e36cc148025b9bbc9 Mon Sep 17 00:00:00 2001 From: Enis Necipoglu Date: Thu, 14 Dec 2023 10:25:42 +0300 Subject: [PATCH] Create Forms-Validation.md --- docs/en/UI/Blazor/Forms-Validation.md | 40 +++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 docs/en/UI/Blazor/Forms-Validation.md 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