|
| 1 | +--- |
| 2 | +description: Learn how to bind and use the validation system when working with Form Controls in Umbraco CMS. |
| 3 | +--- |
| 4 | + |
1 | 5 | # Integrate Validation |
2 | 6 |
|
3 | | -The Validation System provides the abilities to validate various Form Controls. Such can be native or custom, like a Property Editor. |
4 | | -It also allows for binding server validation to the Form Controls. Making the validation experience as synergetic as possible. |
| 7 | +The Validation System provides abilities to validate various Form Controls. Such can be native or custom, like a Property Editor. |
| 8 | + |
| 9 | +It also allows for binding server validation to the Form Controls making the validation experience as synergetic as possible. |
5 | 10 |
|
6 | 11 | ## Validation Context |
7 | 12 |
|
8 | | -The core of the system is a Validation Context, which is the hub of the Validation. |
9 | | -Everything that hold opinions about the Validation, we call a Validator, such is connected to the Validation Context. |
| 13 | +Validation Context, the hub of the Validation, is the core of this system. Everything that holds opinions about the Validation, is a Validator and is connected to the Validation Context. |
10 | 14 |
|
11 | | -You can ask the Validation Context to Validate, this will evaluate all Validators and once all Validator instances have been validated successfully the Validation Context will be valid. |
| 15 | +You can ask the Validation Context to validate. This will evaluate all validators, and once all validator instances have been validated successfully, the Validation Context will be valid. |
12 | 16 |
|
13 | 17 | ## Validators |
14 | 18 |
|
15 | | -We provide a few built in Validators which handles most cases. Here is listed a few: |
| 19 | +We provide a few built in Validators which handles most cases. |
16 | 20 |
|
17 | 21 | ### Form Control Validator |
18 | 22 |
|
19 | 23 | This Validator binds a Form Control Element with the Validation Context. When the Form Control becomes Invalid, its Validation Message is appended to the Validation Context. |
20 | 24 |
|
21 | | -Notice this one also comes as a Lit Directive called `umbBindToValidation`, this enables you to integrate a element with one line of code within a Lit Render method. This is demonstrated in the following example: |
| 25 | +Notice this one also comes as a Lit Directive called `umbBindToValidation`. This enables you to integrate an element with one line of code within a Lit Render method. See the following example for a demonstration: |
22 | 26 |
|
23 | 27 | {% code %} |
24 | 28 | ```typescript |
@@ -51,6 +55,7 @@ render() { |
51 | 55 | ## Integrate Umb-Property Elements |
52 | 56 |
|
53 | 57 | The `umb-property` element automatically binds to its nearest validation context. |
| 58 | + |
54 | 59 | This is demonstrated in the example below: |
55 | 60 |
|
56 | 61 | {% code %} |
@@ -80,8 +85,6 @@ render() { |
80 | 85 | ``` |
81 | 86 | {% endcode %} |
82 | 87 |
|
83 | | - |
84 | | - |
85 | 88 | ## Server Validation and more |
86 | 89 |
|
87 | | -This documentation is not available at the moment. But for the moment you can find more information in the Backoffice repo at `src/packages/core/validation/README.md` |
| 90 | +This documentation is not available at the moment. For the moment you can find more information in the [Backoffice reposiroty](https://github.com/umbraco/Umbraco.CMS.Backoffice/tree/main/src/packages/core/validation). |
0 commit comments