# Fields and Validation

## Overview

To start building your form, go to the Form Dashboard and click **Edit Fields and Validation**. This works like a wizard and you can save at any specific step or work through to the end.

<div align="center"><figure><img src="/files/8ddy0L6CzppiikpRa2w9" alt="Screenshot of the Add Fields and Validation screen in UbiQuity, showing a Form Introduction section and a Fields section with an Add Field dropdown."><figcaption><p>The Add Fields and Validation screen where you build your form fields and introduction text.</p></figcaption></figure></div>

Add fields to your form from the Add Field dropdown. Fields are drawn from your UbiQuity database, so the field type in the database determines what input type is available on the form. A Yes/No database field, for example, can only appear as a selection type on the form.

UbiQuity automatically adds any unique or mandatory fields (without default values) to Subscribe and Subscribe/Update forms, as these are required for the form to work correctly.

***

### Field Properties

For each field you can set:

**Placeholder text** shows respondents what to enter, making the form easier to complete.

**Default value** pre-fills the field. If the respondent does not change it, the default value is saved to the database.

**Field properties** let you change the field display to radio buttons, dropdowns, or other selection types by clicking the properties icon to the right of the field.

You can drag and drop fields to reorder them.

<figure><img src="/files/9c3Wo0tLsL05npoLDRBq" alt="Screenshot of the field properties panel for a First Name field, showing options for field type, default value, placeholder text, size, max length, and a mandatory validation checkbox."><figcaption><p>The field properties panel, showing options for field type, default value, placeholder, size, and validation.</p></figcaption></figure>

***

### Captcha

If you want extra protection against automated form submissions, you can add a Captcha to your form. This adds a simple maths problem that bots cannot solve. UbiQuity already includes a hidden honeypot by default, so a Captcha is optional but provides an additional layer of protection.

***

### Form Validation

Basic validation can be set per field, including making a field mandatory and choosing the error message shown if it is left blank.

For more complex rules, use the Form Validation section at the bottom of the Edit Fields and Validation screen. This lets you build conditional validation rules. For example: if a contact selects email as their preferred contact method, then the email address field becomes mandatory.

<figure><img src="/files/dtaiCWY0y77ngFNspOvL" alt="Screenshot of the Form Validation panel showing a conditional rule: if the email address field from the form equals nothing, then don&#x27;t submit the form and display the message &#x22;Please enter your Email Address&#x22;."><figcaption><p>An example of a conditional validation rule — if the email address field is empty, the form will not submit and a message is displayed.</p></figcaption></figure>

For Update and Subscribe/Update forms, Form Validation can also reference database fields, using the values stored in the database before the form is submitted.


---

# 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.ubiquity.co.nz/documentation/data-capture/forms/fields-and-validation.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.
