# How to restrict input in a text field?

If you want to allow an input to only receive a certain number or text format, you can use regular expressions.

For example, let's say that you want your input to receive an ID number that is structured like this: “010.124.501-55”. If you don’t know how to write regular expressions, you can simply ask any AI bot to do this for you, [ChatGPT](https://chat.openai.com/) for example:

<figure><img src="/files/sjsnCQjoes6hy54DBKv5" alt=""><figcaption></figcaption></figure>

After you get your regular expression, you can input it in the validation field of your component. Click on the component in builder -> Display tab -> Validate -> Use Regular expression

<figure><img src="/files/ihXmhUwLXJ3NjF4LOrW8" alt=""><figcaption></figcaption></figure>

You can also mention your field format in the custom validation error field for easier understanding.<br>


---

# 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://docs.jetadmin.io/faq-and-troubleshooting/how-to-restrict-input-in-a-text-field.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.
