# Required and rules

Make a question required and set the rules an answer must follow before the form can be sent.

## Make a question required

Click the question, open **General**, and turn on **Required**. The form cannot be sent until it has an answer, and the person is told which question is missing.

To make a question required only sometimes, see [Show or hide questions](https://form.invoy.in/docs/guides/conditional-logic/).

## Set rules for an answer

Click the question and open the **Validation** tab. What you find depends on the field.

| Field | Rules |
|---|---|
| **Short Answer** | Minimum and maximum length. A regex pattern, with a message to show when the answer does not match |
| **Long Answer** | Minimum and maximum length |
| **Email** | The answer must look like an email address. You can also add a regex pattern |
| **Number** | Minimum and maximum value |
| **File Upload** | The kinds of file, the size, and the number of files. See [Collect files](https://form.invoy.in/docs/guides/file-upload/) |

> **Note:** A regex pattern is on the Pro plan and above. A question that has one needs a plan that has it, or the form cannot be saved.

## Where the rules are checked

The form checks each answer as the person fills it in. We check it again on our server when the answer arrives, so the rules also hold for a response that comes from [your own HTML form](https://form.invoy.in/docs/developer/html-post/). An answer that breaks a rule is refused and the person sees why.

## Good to know

- A rule that contradicts another one is caught when you save, for example a minimum larger than the maximum.
- A regex pattern that could hang the server is refused when you save.
- An empty answer to a question that is not required is not checked against its rules.
