# Form Rules

![](https://1227319489-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0am6ErECnhVZlKhXUH3q%2Fuploads%2Fzvc4B22YjFLvR0MfPSBO%2FForm%20Rules.PNG?alt=media\&token=542a234f-26a2-4892-8c24-0255f302272d)

### 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>" %}
