diff --git a/docs/en/UI/Blazor/Forms-Validation.md b/docs/en/UI/Blazor/Forms-Validation.md new file mode 100644 index 0000000000..da703d3921 --- /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 + +_The example is 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 diff --git a/docs/en/docs-nav.json b/docs/en/docs-nav.json index afdf89657c..e227d14c25 100644 --- a/docs/en/docs-nav.json +++ b/docs/en/docs-nav.json @@ -872,6 +872,10 @@ "text": "Navigation / Menu", "path": "UI/Blazor/Navigation-Menu.md" }, + { + "text": "Forms & Validation", + "path": "UI/Blazor/Forms-Validation.md" + }, { "text": "Localization", "path": "UI/Blazor/Localization.md"