> For the complete documentation index, see [llms.txt](https://docs.eximee.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.eximee.com/documentation/documentation-en/budowanie-aplikacji/interfejs-uzytkownika/formularze/praca-z-komponentami-bazowymi/walidacja-wartosci-komponentow/walidacje-proste-wbudowane.md).

# Simple validations (built-in)

Simple validations are a set of basic checks available directly in Eximee Designer. They are configured by setting the appropriate component properties in the panel **Data quality**. Below are the most important built-in validation methods:

* **Field requiredness** – determines whether the field must be filled in by the user. It is set using the property **Required condition (requiredCondition)** in the section **Data quality** of the given component. If we want the field to always be required, we provide the boolean value as the condition `true`. We can also introduce a more complex condition depending on other fields – for example, a text field becomes required only when the user selects a specific checkbox. Conditions are defined in the condition editor and can refer to the values of other components or session variables. **Example:** For the field *Email* you can set **requiredCondition** to `getValue("GesCheckbox1") == "true"`, which means that the email address will be required only if the consent checkbox was selected earlier. In such a situation, you should also make sure that the Email field **listens** for changes in the value of this checkbox - this is handled by the "Listening" property in the interaction panel. Thanks to listening, when the user checks or unchecks the checkbox, the form will immediately recheck the required condition for the Email field. If the required condition is not met (i.e. the field is required but empty), the user will not be able to proceed to the next step, and an error message will appear under the field informing that the field is required.

<figure><img src="/files/d85fe6d57f157c4593b61f243d65f519e12a7f8e" alt=""><figcaption><p align="center"><em><strong>Figure 1.</strong> Example of a required-field condition dependent on the value of another component (here, a checkbox)</em></p></figcaption></figure>

* **Minimum/Maximum number of characters** – determines the allowed length of text in the field. For the component **Text Area (TextArea)** the properties are available **minLength** (minimum number of characters) and **maxLines** (maximum number of text lines). For **Text Field (TextField)** you can set **Minimum number of characters (minLength)** and **Maximum number of characters (maxLength)**, which defines the maximum length of the entered text. For example, to require entering at least 50 characters of description in the comment field, we set minLength = 50 - if the user enters less, they will see a message stating that a longer response is required.
* **Mask (regular expression)** – allows you to define **a pattern**that the entered value must match. It is used e.g. to validate formats such as postal code, phone number, tax ID, etc. Configuration consists of entering the regular expression in the field **Mask** (section *Data quality* of the component), and then entering the text of the error message in the field **Mask matching error message**. If the user enters a value that does not match the specified regex, the defined message will be displayed under the field, and the form will not allow moving on until the value is corrected. **Example:** For the field *Postal code* we can set the mask `\d{2}-\d{3}` and the message "Invalid postal code format". Entering a string that does not match this pattern (e.g. with letters or an incorrect digit layout) will cause an error to be displayed.

| Regular expression                                                                     | Meaning                                                                                                                                                                                                                                                                           | Example values                                            |
| -------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------- |
| \d{2}-\d{3}                                                                            | Postal code                                                                                                                                                                                                                                                                       | 61-897                                                    |
| \d{11}                                                                                 | PESEL                                                                                                                                                                                                                                                                             | 75010125915                                               |
| (\d{3}\[- ]\d{3}\[- ]\d{2}\[- ]\d{2})\|(\d{3}\[- ]\d{2}\[- ]\d{2}\[- ]\d{3})\|(\d{10}) | NIP                                                                                                                                                                                                                                                                               | <p>782-226-19-60<br>or 782-22-61-960<br>or 7822261960</p> |
| \[a-zA-ZąćęłńóśźżĄĆĘŁŃÓŚŹŻ]+\[a-zA-ZąćęłńóśźżĄĆĘŁŃÓŚŹŻ\ \\-\\']\*                      | The field starts with a letter, then only letters, space, hyphen, apostrophe. Example use in a first name or last name field.                                                                                                                                                     | Janina Nowak-Kowalska                                     |
| \[0-9\\(\\+]+\[0-9\ \\(\\)\\+\\-]\*                                                    | <p>The field starts with a digit, an opening parenthesis or a plus sign, then only digits, parentheses, spaces, plus signs, hyphens.<br>Example use in a phone number field (an alternative solution to the sample mask from <strong>visibleMask Mask presentation</strong>).</p> | <p>+48 (12) 31 23 123<br>or (48) 123-123-123</p>          |
| \[0-9A-Za-z]\*                                                                         | Ability to enter only digits and letters                                                                                                                                                                                                                                          | <p>abc123</p><p>123abc</p>                                |
| \[0-9]{6}\[\\\*]{1,6}\[0-9]{4}                                                         | Masked card number - the field should be filled in by entering the first 6 digits and the last 4 digits of the card number, separated by " \* " characters (maximum six special characters: " \* ").                                                                              | 123456\*\*7890                                            |

* **Mask presentation (visibleMask)** – not to be confused with the regex mask above. Mask presentation is used to define the format in which **while typing** the characters in the text field should be arranged. A typical example is automatically adding hyphens or spaces in a postal code, tax ID, or credit card number while typing. The property **Mask presentation** we also specify in the section *Data quality*. A special syntax is used here (e.g. digits, letters, special characters) to define the display format. **Example:** For a tax ID number, we want the format `999-999-99-99` – the appropriate mask presentation expression will make the user enter a continuous string of digits, and on the screen they will appear divided into 3-3-2-2 with automatically inserted hyphens. Mask presentation concerns only the appearance of the entered data for user convenience - it does not verify the correctness of the value itself (that is what the regex mask is for). The following characters occur among the elements of the mask definition:
  * **S** - represents any character that is a letter (A-Z, a-z),
  * **9** - represents any character that is a digit (0-9),
  * **A** - represents any alphanumeric character (A-Z, a-z, 0-9),
  * **?** - mask elements placed after "?" are optional.

| Mask definition        | Meaning                                     | Mask presentation                   | Example values                            |
| ---------------------- | ------------------------------------------- | ----------------------------------- | ----------------------------------------- |
| 99-999                 | Postal code                                 | \_\_-\_\_\_                         | 61-897                                    |
| 99999999999            | PESEL                                       | \_\_\_\_\_\_\_\_\_\_\_              | 75010125915                               |
| 999-999-99-99          | NIP                                         | \_\_\_-\_\_\_-\_\_-\_\_             | 782-22-61-960                             |
| +99 99 99 99 999? w999 | Phone number with optional extension number | +\_\_ \_\_ \_\_ \_\_ \_\_\_ w\_\_\_ | +48 61 41 51 000 or +48 61 41 51 000 w001 |

### Validation after each character <a href="#walidacjeproste-walidacjapokazdymznaku-validationoneverysign" id="walidacjeproste-walidacjapokazdymznaku-validationoneverysign"></a>

In the section **Data quality** there is an option **Validation after every character (validationOnEverySign)** - allows validation (only field requiredness and mask) to be triggered on the component after each entered character. The component's default value is "false".

{% hint style="info" %}
Demo conclusions: demoRegex, demoMaskPresentation, demoValidators
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.eximee.com/documentation/documentation-en/budowanie-aplikacji/interfejs-uzytkownika/formularze/praca-z-komponentami-bazowymi/walidacja-wartosci-komponentow/walidacje-proste-wbudowane.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
