# Validation

Each EasyEdit component can have its own custom validation rules, see examples below:

### Input validation

The component below shows how easy it is to add a basic null check on the component's value. if the user attempts to save without adding any value in the field rendered, then they will see the validation message "Please provide a valid value" and the component will prevent them from saving. You can always change the validation message by passing in the message you would like in the `validationMessage` prop or overwrite the style by overwriting the css class `easy-edit-validation-error`

```jsx
<EasyEdit
  type={Types.TEXT}
  onSave={(value) => {alert(value)}}
  onValidate={value => {return value != null}}
/>
```


---

# 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://giorgosart.gitbook.io/react-easy-edit/validation.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.
