# Validation rules

The purpose of a form is to validate the entered data. Unlike other solutions, where a developer is given a single `validate` function, React Advanced Form uses smart built-in validation algorithm based on the [Validation schema](/react-advanced-form/validation/schema.md). It is a convenient functional way of declaring validation rules, from simple to complex.&#x20;

This part is going to focus on how to declare a validation schema and write the rules. We are going apply the validation rules and messages to the forms in the next part.

{% content-ref url="/pages/-LDfz\_oSEEoL-XYGJM2g" %}
[Getting started](/react-advanced-form/validation/getting-started.md)
{% endcontent-ref %}


---

# Agent Instructions: 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:

```
GET https://redd.gitbook.io/react-advanced-form/getting-started/validation-rules.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
