> For the complete documentation index, see [llms.txt](https://docs.xforms.co/xforms-manual/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.xforms.co/xforms-manual/form-controls/general.md).

# General

General Form Controls Settings

| Setting      | Description                                                                                                                         | Value                                                                                                                          |
| ------------ | ----------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| type         | Type of the form control                                                                                                            | <p>"img" for image<br>"txt" for Text<br>"dat" for Date<br>...</p>                                                              |
| readonly     | Set the field to read-only or editable (optional)                                                                                   | true/false                                                                                                                     |
| required     | <p>Set if a value must be provided to submit the form (optional)<br>Cannot be used with "<em>requiredWhen</em>" setting.</p>        | true/false                                                                                                                     |
| requiredWhen | <p>Set if a value is required to submit, if the condition is met (optional)<br>Cannot be used with "<em>required</em>" setting.</p> | <p>a 3-part conditional statement in form of <br>"<em>field\_id~~operator~~value</em>"<br>See the notes below for details.</p> |
| fullWidth    | control takes the whole line                                                                                                        | true / false                                                                                                                   |

### Notes

"requiredWhen" setting is a 2 or 3-part statement in following format:

*"field\_id\~operator"* or *"field\_id\~operator\~value"*

* field\_id: ID of the field to compare with
* value: the value to compare the field (above) with. This could be a single number or string, or a list of values (optional)
* operator: one of the following operators

  * checked : checks if the checkbox with specified ID is checked.
  * unchecked : checks if the checkbox with specified ID is unchecked.
  * \= : checks if the value of the field is equal to one of the items in the value list\
    &#x20;     example: cityField\~=\~'Boston','Chicago' \
    &#x20;                      the current field is required, if cityField is one of the cities in the list.
  * <> :
  * < :&#x20;
  * \> :&#x20;
  * \>= :&#x20;
  * <= :&#x20;
  *
