Toggle field
What it does
A Toggle field shows an on/off switch with a short caption next to it, such as "Add the five-year furniture protection plan". The visitor turns it on or leaves it off. You find the field in the builder's left panel, in the Options group, and add it by dragging it onto the form, as described in Adding fields and sections.
To see the answer, go to Content → WebForms → Inbox and open the submission. The field shows "Yes" when the switch was on and "No" when it was off.
When to use
Choose Toggle for one yes-or-no question that reads well as a sentence, such as an extra service or a preference. When the visitor must pick between named answers, a Radio field says more. To collect agreement to your terms with a record of the wording, use the Terms field.
Settings
Go to Content → WebForms → Manage Forms, click the form's name, then click Form Builder. Click the field on the form. Its settings show in the right panel, on the tabs General and Appearance. You'll change these settings most often:
- Switch Caption (General tab) is the text visitors see next to the switch. Write it as the thing that happens when the switch is on. If you leave it empty, the field's label shows there instead.
- Label (admin only) names the field in the builder, on the submission page and in emails. Visitors don't see it above the switch. A new field is called "Toggle".
- Default State is Off for a new field. Select On to show the switch already on.
- Required makes the visitor turn the switch on before the form can be sent. When you turn it on, Required Error Message appears below Required for your own wording.
The table below lists every setting. Visitors see a change after you click Publish Changes in the builder's top bar.
All settings of this field
| Setting | Where in the panel | Values | Translatable |
|---|---|---|---|
| Enable Field | General → Basic | On or off | No |
| Label (required) | General → Basic | Text | Yes |
| Field Code | General → Basic | Text | No |
| Required | General → Basic | On or off | No |
| Required Error Message | General → Basic | Text | Yes |
| Help Text | General → Basic | Formatted text | Yes |
| Tooltip | General → Basic | Formatted text | Yes |
| Switch Caption | General → Field Settings | Text | Yes |
| Default State | General → Field Settings | Off, On | No |
| Hide in Submissions | General → Submission Display | On or off | No |
| Allow in Staff Email Subject | General → Submission Display | On or off | No |
| Submission Label | General → Submission Display | Text | Yes |
| Personal Data | General → Privacy | By field type — Not personal, Not personal, Personal data | No |
| Desktop | Appearance → Layout | Width: Full (1/1), Half (1/2), Third (1/3), Quarter (1/4), Fifth (1/5), Sixth (1/6), 2/3, 3/4, 2/5, 3/5, 4/5, 5/6; New row: on or off | No |
| Tablet | Appearance → Layout | Width: Full (1/1), Half (1/2), Third (1/3), Quarter (1/4), Fifth (1/5), Sixth (1/6), 2/3, 3/4, 2/5, 3/5, 4/5, 5/6; New row: on or off | No |
| Mobile | Appearance → Layout | Width: Full (1/1), Half (1/2), Third (1/3), Quarter (1/4), Fifth (1/5), Sixth (1/6), 2/3, 3/4, 2/5, 3/5, 4/5, 5/6; New row: on or off | No |
| Show Label | Appearance → Style | On or off | No |
| Help Text Position | Appearance → Style | Below input, Above input | No |
| Container Classes | Appearance → CSS | Text | No |
| Input Classes | Appearance → CSS | Text | No |
| Custom Attributes | Appearance → Advanced | Text | No |
| Inline Style | Appearance → Advanced | Text | No |
In the panel, the setting the table lists as Label (required) reads Label (admin only), because visitors don't see it.
Validation
| Check | What the visitor sees when it fails |
|---|---|
| Required | "This is a required field." under the switch, or your Required Error Message. |
Logic
- Start a rule: no. A Toggle field can't start one, so it can't show or hide other fields. Its Logic tab appears only once a rule shows or hides the toggle, and lists that rule. To ask a follow-up question, use a Radio field with the answers "Yes" and "No" instead. See Show or hide fields and sections.
- Show or hide this field: yes, from a rule that starts on a field with options.
- Email conditions: yes, with Is and Is Not. Type
1as the value, which means "on": Is1matches a switch that was on, Is Not1matches one left off. The word "Yes" doesn't match. See Recipients and conditions.
Limits
- A notification email with all answers leaves out a switch that was off. Only the submission page shows "No". If the people who read the email need the "No", write it into the email yourself, or use a Radio field.
Troubleshooting
- Visitors don't see the field's label. That's by design: the switch shows Switch Caption. Put the question into the caption.
- A notification condition on the switch never matches. Type
1as the value, not "Yes". - Your change doesn't show on the storefront. Changes stay in the draft until you click Publish Changes. See Drafts, publishing and versions.
What's next
- Radio field: named answers, and follow-up questions with rules.
- Recipients and conditions: send an email only when the switch was on.