Form builder
Use the FormDB form builder to define fields, add server-side validation, preview the form and copy generated HTML, React or Vue code.
This page explains what the form builder does, the field types it offers, and how its Edit, Preview and Code tabs work. It also covers what happens to fields your form sends that you never defined in the builder.
What the builder is
FormDB does not host your form. Your form lives on your own website. The builder is where you describe the fields that form has, so that FormDB can do two things for you:
- Check every submission on the server. Required fields and validation rules are enforced by FormDB, even if someone bypasses the checks in the browser.
- Generate the code. The builder writes HTML, React, Vue, Fetch and jQuery code for your fields, ready to paste into your site.
Using the builder is optional. A form with no builder fields accepts anything that is sent to it.
Open the builder
You need the admin or owner role. Open it in any of these ways:
- On a form page, click Form builder in the header.
- On the Forms page, open a form's menu and choose Open builder.
- When creating a form, choose Build visually.
Field types
Type | What it collects |
|---|---|
Short text | A single line of text |
An email address | |
Long text | Multi-line text |
Number | A numeric value |
Phone | A phone number |
URL | A website address |
Date | A calendar date |
File upload | One or more files |
Checkboxes | Any number of options from a list |
Radio group | Exactly one option from a list |
Dropdown | One option from a list |
A form can have up to 100 fields.
The Edit tab
The Edit tab has three areas: a palette of field types on the left, the canvas with your fields in the middle, and an inspector for the selected field on the right. On smaller screens the inspector opens as a side panel and the palette becomes an Add menu.
Add and arrange fields
- Click a field type in the palette to add it after the selected field, or drag it to a position on the canvas.
- Hover between two fields and click the plus button to insert a field at that spot.
- Drag a field by its handle to reorder it.
- Hover a field to reveal Duplicate and Delete. Clear in the top bar removes all fields after a confirmation.
Edit a field
Select a field to edit it in the inspector.
Property | What it does |
|---|---|
Field type | Changes the type. This removes the field's validation rules. |
Label | The text shown to visitors, and used in error messages. Up to 200 characters. |
Field name | The key you see in submissions, exports and webhooks. It must match the |
Placeholder | Hint text inside the input. Not available for Checkboxes, Radio group and File upload. |
Help text | A note for the field, up to 500 characters. It is shown in the dashboard test form and is not included in generated code. |
Required | When on, FormDB rejects submissions without a value for this field. Off by default. |
The field name is filled in from the label automatically, for example "Full name" becomes full_name. Once you edit the name by hand it stops following the label. Names must start with a letter or underscore, and each name can be used once per form.
Checkboxes, Radio group and Dropdown fields also have an Options list. Click Option to add one. A field can have up to 100 options. When options are defined, FormDB rejects any submitted value that is not one of them.
Most field types have a Validation section where you add rules such as a minimum length or allowed file types. See Validation rules.
Saving
The builder does not save automatically. Click Save, or press Cmd+S on a Mac or Ctrl+S on Windows. An Unsaved badge shows when you have changes that are not saved yet. There is no undo, so check before you delete a field.
Server-side validation uses the last saved version of your fields.
The Preview tab
Preview shows your fields as a visitor would see them, including unsaved changes. It is a preview only and cannot send a submission. To send a real test, use the Setup tab of the form.
The Code tab
Code shows generated code for your current fields, with tabs for HTML, React, Vue, Fetch and jQuery. The same code is available on the form's Setup tab under 2. Copy the code.
What the generated code includes:
- An input for each field, with its label,
nameandrequiredattribute. - Browser-side versions of some rules, for example
minlength,maxlength,pattern,min,maxandaccept. - The
_gotchahoneypot field (HTML, React and Vue). enctype="multipart/form-data"in the HTML version when there is a File upload field.- Your captcha widget, when a captcha provider is set in the form's settings.
Things to check after pasting:
- In the React, Vue and jQuery versions, make sure the error handling reads
body.error.message. FormDB returns errors as{"ok": false, "error": {"code": "...", "message": "..."}}. See JavaScript and AJAX for complete examples. - The Fetch and jQuery versions contain no form markup, so they have no honeypot or captcha widget. Add those to your own form.
- With reCAPTCHA v3, only the HTML version includes the code that fetches a token. See Captcha.
- The generated code is unstyled. Add your own CSS.
Fields that are not in the builder
Your form can send fields you never added to the builder. FormDB accepts them and stores them as they are, without validation. They appear in the inbox, exports, emails and integrations like any other field.
Only fields defined in the builder are checked. This means:
- If you rename an input in your HTML, update the Field name in the builder too. Otherwise a required builder field will be reported as missing.
- If a field must be validated, define it in the builder. A
requiredattribute in your HTML alone is not enforced by FormDB.
Next steps
- Validation rules: every rule and its error message.
- File uploads: limits and plans for File upload fields.
- HTML forms: connect the generated HTML to your site.
Ready to try it? Create a free account and send your first submission.