Elements and Widgets

Form

38min



Form widget is used to create forms that are an important part of many websites. This can be registrations forms, feedback forms, order forms, and so on.

Document image




Form structure

Form structurally contains three child elements

  • Default State – contains all form elements.
  • Success State – contains the message returned after successful form submission.
  • Error State – contains the message returned after failed form submission.
Form structure
Form structure


These elements display three possible states of a Form. When a Form is created, it has Default state. This state is used to make major changes in a Form, e.g. add and remove elements, set it styles.

To control a Form in Success or Error state, you need to switch it in the Settings. For more details, see Form and fields states.

When created, a Form contains the following elements

  • Form title
  • Name input field
  • E-mail input field
  • Submit button



Form elements

In addition to the Form widget, the Elements panel contains individual elements that can be added to a Form.

Form Elements in the Elements Panel
Form Elements in the Elements Panel




Input field

Input field is used to collect one-line data.

Document image


You can use an input field to enter multiple types of data:

  • Plain text
  • E-mail
  • Phone
  • Number
  • Date

You can select the required data type in the Settings in the right panel in the Type field.

Document image


Phone data type assumes an additional setting, Field mask, which allows you to select a template for entering a phone number for different countries. 

Document image


After selecting a country, the corresponding template appears in the field.

Document image


Setting the data type for the Input field allows the user to enter data of the selected type. In the case of incorrect data type, an error will be displayed.  

Input field example
Input field example




Text Area

Text Area allows the user to enter multi-line data, such as lengthy messages. It is commonly used to enter comments, reviews, and other long text.

Document image

Text Area example
Text Area example




Checkbox

Checkbox is an element that can be used by the user to answer closed (Yes/No) questions. Best used when the user may or may not agree to some condition.

Document image


Checkbox allows you to make single- or multiple-choice selections. You can add options in the Settings by clicking on the + button in the List Items section.

Document image


You can also delete an option by clicking on -, or swap options by dragging the icon to the left of the name.

Document image


You can click on the desired name and enter a new one to change the name of an option.

Checkbox example
Checkbox example




Radio buttons

Radio buttons allows the user to select one out of multiple options.

Document image


Just like for Checkboxes, you can add options for Radio Buttons in the Settings.

Document image

Radio buttons example
Radio buttons example




Select field

Select field is a drop-down list that allows to select one or several list items. 

Document image


By default, there are three options in the select list. You can edit options in the Settings by adding, removing, swapping, and renaming them.

Document image


By default, the user can only select one item from the list. To select several items at a time, you need to enable Allow multiple selection option. In this case, the user will be able to select multiple options from the list using Shift or Ctrl.

Document image

Example of Radio buttons with single item selection
Example of Radio buttons with single item selection

Example of Radio buttons with multiple selection
Example of Radio buttons with multiple selection




Submit Button

When clicking the Submit button, all the data entered by the user are sent to the website owner.

Document image


Every created Form has the Submit button by default.  



Adding elements in a Form

You can add any element in a Form, such as an Input field or a Checkbox, to customize the desired functions. 

Document image


Also, if necessary, you can add ordinary elements or widgets to a Form, for example, a Text with a description or a Div Block for grouping the elements.

Please note that all Form elements are in the Default State block, so new elements must be added to this block.

Document image


To add an element to a Form:

  • drag and drop the required element into a Form from the Elements panel.
  • or select a Form (Default State block) on the Canvas or the Layers tab and click on the name of the required element in the Elements panel.

Form elements can only be added to a Forms block and dragged only within it.



Structure of the Form elements

Each form element (except the Submit button) is a group of elements with the following structure:

  • Field Label is a text element with a field name that is displayed on a webpage. You can edit text of a Field Label and also remove a Label from the page.
  • Field (name depending on the element) is an element of a Form itself, with which the user interacts.
  • Error Message is a message that is displayed when there is an error in a field (for example, if a required field is not filled). The error message can be changed by switching the Form state. For more details, see Fields states.

For example, the structure of the Input Group looks like this:

Input field structure
Input field structure




Form elements settings

General settings

On the Settings tab in the right panel, you can view the options for each element of a Form. These options will vary depending on the element type. For example, an Input field has the Type option and a Checkbox, Radio Buttons and a Select field has the List item option.

All Form fields (except the Submit button) have two parameters:

  • Field name is a header transmitted to the data with the form submission.
  • Required field, if set, prohibits the user from submitting a form without filling in this field.
Document image




Placeholder

Input field and Text Area elements additionally have the Placeholder setting. This setting is used to display a default text that disappears when the user starts typing in a field. This can be a field name or a sample text.

Document image


Do not use placeholders as an input field label or help text (for example, “Password must be at least 8 characters long”). Placeholder will not be translated for site visitors using the translation tools and will not be available to screen readers. Also, placeholder disappears when the user starts typing in a field, making it difficult for him to access that information. For these purposes, it is better to use a separate text field.



Form and fields states 

In the Form Settings you can switch the Form state and the Fields state:

Document image




Form states

By switching the Form States in the Settings, you can see on the Canvas what a Form looks like in this particular state

  • Default State is the default state before the user interacts with a Form. 
Document image

  • Success State is the Form state after its successful submission. Following successful submission there will appear a message that you can change and customize as you wish. 
Document image

  • Error State is the Form state after its unsuccessful submission. Following unsuccessful submission there will appear an error message that you can change and customize as you wish.
Document image




Editing the error and success messages

To edit the success message for a form:

  • select a Form (on the Canvas or the Layers tab).
  • in the Settings > Form State, select Success.
Document image

  • edit the text of the success message on the Canvas.
Document image


To edit the error message for a form:

  • Select a Form (on the Canvas or the Layers tab).
  • in the Settings > Form State, select Error.
Document image

  • edit the text of the error message on the Canvas.
Document image




Fields states

A form field has two states:

  • Default State is the default state before the user interacts with a Form.
  • Error State is the field state when errors occur in the course of form submission. Following unsuccessful submission there will appear an error message that you can change and customize as you wish.

To edit the error message for a field:

  • Select a Form (on the Canvas or the Layers tab).
  • in the Settings > Fields state, select Error.
Document image

  • edit the text of the error message on the Canvas under the desired element. 
Document image




Styling a form

By default, a Form inherits the full width of its parent. You can customize the styles for a Form, including size, paddings, margins, element placement, and more. To do this, select a Form on the Canvas or the Layers tab and set the desired styles on the Styles tab. 

For example, you can arrange form fields horizontally. To do this:

  • Place the Form fields in a new Div block.
Document image

  • Set the Flex in the Styles, horizontal direction, and alignment.
Document image

Document image




Styling the Form elements

Also, you can style all Form elements individually. You can set styles for the entire group, for example, by setting paddings or margins. You can also style the label and the element field individually.

For example, you can change the font of the Form header and field labels, the size and placeholder for input fields, the color and size of a button, and so on.

Document image


For Input fields, you can replace Field Labels with Placeholder. To do this:

  • You must hide the field labels (in the label element settings in the Display section) or remove the label element from the Canvas.
Field label element of an Input field
Field label element of an Input field

  • Set Placeholder in the Input field settings.
Placeholder in the Input field settings
Placeholder in the Input field settings

Input field with Placeholder
Input field with Placeholder




Styling Checkboxes, Radio buttons, Select fields

By default, Checkboxes, Radio Buttons, and Select fields have custom styles, i.e. you can set styles for their elements. In the Form settings, you can enable additional styles options - Apply standard browser styles to Checkbox and Radio Buttons and Apply standard browser styles to Select. In this case, these fields will have browser styles and it will be impossible to customize styles for their states.

Document image




Styling Placeholder

To style placeholder:

  • Select a Form element on the Canvas (you need to select the element itself, not a group of elements).
Document image

  • On the Styles tab, in the State section, check Placeholder and set the desired styles for it.
Document image


For example, you can change the font size or placeholder color.

Document image




Updated 05 Oct 2023
Did this page help you?