# Form Rules

![](/files/1k97F7IZnPzxuJw12BgB)

### Apply form logic through form rules

You can create form rules and recommendations to apply form logic without writing JavaScript code. Form rules provide a simple interface to implement commonly used rules. By combining conditions and actions, you can do the following with form rules:

* Set field value based on a formula, a value from another field, and a constant value.
* Clear field values.
* Make the field required.
* Show or hide fields.
* Enable or disable fields.
* Validate data and show error messages.
* Change field instructions.

### Create a form rule

1\. Go to form explorer.

2\. Select the form you want to create the form rule for, then click on the ‘Rules -> Form Rules’ menu item from the toolbar.

![](https://captisa.com/wp-content/uploads/2018/11/FormRules1-1.png)

3\. Click![](https://captisa.com/wp-content/uploads/2018/11/NewRule.png)

The form rule designer opens with a single condition and action created for you. The form rule takes one or more actions based on that condition.

![](https://captisa.com/wp-content/uploads/2018/11/FormRuleNew.png)

4\. Add a rule name in the description box.

5\. Add condition. To Add condition:

a. Select a field from the list.

![](https://captisa.com/wp-content/uploads/2018/11/FieldList.png)

b. Select an operator from the list. The selected field drives the list items.

![](https://captisa.com/wp-content/uploads/2018/11/Operator.png)

c. Select or enter condition value.

![](https://captisa.com/wp-content/uploads/2018/11/conditionValue.png)

6\. Add action. To add action:

a. Select an action from the list.

![](https://captisa.com/wp-content/uploads/2018/11/actionList.png)

b. Select the field(s) for which you want to apply the action.

7\. To save the form rule, click Save.

Below is an example of a form with rules to make fields required or not required based on the value of another field. See [**form rule**](https://secure.captisa.com/template?id=5df90e00-6061-4248-9249-0540a634bbec) in action.

![](https://captisa.com/wp-content/uploads/2018/11/FormRuleRequiredExample.png)

### See it in action

{% embed url="<https://secure.captisa.com/p?embed=true&id=279a1ef4-dae7-48ea-8cc2-5f3f616b8ef6&prefill=1>" %}

{% embed url="<https://secure.captisa.com/p?embed=true&id=cd0b6e7b-01fb-49a3-82b7-f8799639ea8f>" %}


---

# 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.captisa.com/guides/form-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.
