# 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

This form, as people see it. A star marks a question that is required, and the form is not sent until each of them has an answer.

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 |
| **Date** and **Date and time** | The earliest and latest date, and the days of the week it takes |
| **Time** | The earliest and latest time |
| **URL** | The answer must be a web address. You can take links to only some websites (and their pages and subdomains) |
| **Checkbox** | When it is required, it has to be ticked |
| **Rating** and **Linear scale** | A whole number from the first level to the last |
| **Multiple choice grid** and **Checkbox grid** | The choices must be from the rows and columns you set. **Answer every row** asks for a choice in each row |
| **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.

Try it. Press **Submit** with nothing filled in, then with an email that is not one.

## 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.
