Color field
What it does
A Color field lets the visitor choose any color, for example the thread color of an embroidered cushion. You find the field in the builder's left panel, in the Advanced group, and add it by dragging it onto the form, as described in Adding fields and sections.
On the storefront the field is a short box with a small color square at its start. While the box is empty, the
square is crossed out. The visitor clicks the box, and a color picker opens below it: a shade area and a
rainbow strip. When they pick a color, the box fills with its hex code, such as #8a5a44, and the square shows
the color. The visitor can also type a hex code
into the box. The box looks the same on the Luma, Hyvä and Breeze themes.
To see the answer, go to Content → WebForms → Inbox and open the submission. It shows a small square in the chosen color next to the code.
When to use
- Use Color when any shade is possible, for example a custom paint or thread color.
- Use Swatches when the visitor picks from your own short list of colors, such as the finishes you stock. You then see the name of the finish rather than a code. See Swatches 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:
- Label (General tab) is the name visitors see above the box.
- Default Color is the color the field starts with. Type a hex code such as
#8a5a44. The visitor sees it filled in and can change it. Leave it empty to start with an empty box. - Placeholder is the grey text in the empty box, for example
Pick a thread color. It shows only while the box is empty, so it has no effect when Default Color is set. - Required makes the visitor choose a color before the form can be sent. With a Default Color set, the box is never empty, so the visitor can send the form without changing it.
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 |
| Placeholder | General → Field Settings | Text | Yes |
| Default Color | General → Field Settings | Text | 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 |
| Browser Autocomplete | General → Advanced | Text | 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 |
What is saved
The field saves the text in the box exactly as it is when the form is sent. A color picked in the picker is
saved in lower case, such as #c8a574. A code the visitor types keeps their spelling, such as #2F4F4F.
The box doesn't check what is typed. A visitor who types a word such as brown can send the form, and brown
is saved. The submission page then shows the word without a color square.
| Where | What you see |
|---|---|
| Submission page in the admin | A small square in the color, then the code. |
| Notification email with all answers | The code. |
| PDF of the submission | The code. |
Validation
A Color field has no Validation tab. The only check is Required on the General tab. When the box is empty, the visitor sees "This is a required field." under it, or your Required Error Message.
Logic
- Start a rule: no. Only fields with options can start a rule. A Logic tab appears on a Color field only once a rule shows or hides it, and lists that rule.
- Show or hide this field: yes, from a rule that starts on a field with options. See Show or hide fields and sections.
- Email conditions: yes. The operators are Is, Is Not, Contains, Starts With and
Ends With. They compare the saved text, so
#2F4F4Fand#2f4f4fcount as different answers.
Limits
- Colors are saved as hex codes only. The field doesn't convert them to RGB, paint names or the colors of your products.
- The color looks different on each screen. For an exact match, ask for a paint code or a sample in a separate field.
Troubleshooting
- The submission shows a word instead of a color. The visitor typed it into the box. Ask them for the color again, or use a Swatches field with the colors you offer.
- Required doesn't stop an unchanged color. Default Color fills the box in advance. Clear Default Color if the visitor must choose.
- 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
- Swatches field: let visitors pick from colors you choose.
- Text field: ask for a paint code or a color name as text.