Select

The select field creates a dropdown list with options.

Demo

To learn how to add, edit, clone, move, resize, offset, or delete a select field, please click here.

To edit the settings for this field type, click the sett ings icon on the field itself. Click the Save & Close or Save button to save your changes. If you do not want to save your changes, you can click the Cancel button or click any other form element to close the field settings sidebar.

WS Form - Field Settings Icon

Basic

The basic tab contains settings that the majority of WS Form users will need to control a field. The settings are as follows:

Label

This is the label shown alongside the field. As well as entering a label into this field, you can also double click the label of the field in the editor. You should enter an easy-to-understand label for your field, for example, First Name or Email.

Show Label

If enabled the label will be shown on your form. If you do not want the label to appear for a particular field, uncheck this box.

Required

If checked this field will be required when the website visitor completes your form. Failure to complete the field if this is checked will result in a validation message appearing under the field prompting the user to complete the field correctly.

Required fields are indicated on your website with the word Required being adding to the label of the field. This can be changed in the form settings advanced tab.

Hidden

If checked the field will be hidden on the form. It can be shown again using conditional logic or your own JavaScript.

Multiple

Enabling this feature will enable the website visitor to select more than one option when submitting the form.

Selecting multiple options varies in different operating systems and browsers:

  • For Windows: Hold down the control (CTRL) button to select multiple options.
  • For Mac: Hold down the command button to select multiple options.

Because of the different ways of doing this, and because you have to inform the user that multiple selection is available, you may wish to consider using checkboxes instead.

Default Value

If a value is entered into this setting, the option containing that value will be selected by default. Note that this value needs to be the option value not the text shown for the option.

Comma separated values can be entered into this setting. Values will be trimmed.

Other ways of setting the default value, include:

  • Select rows in the Options tab using the Selected icon. Learn more
  • Set the default value using PHP. Learn more
  • Use the WordPress Filter Hook Data Source. Learn more

Size

Selects fields are typically one row tall. You can make a Select field taller by increasing this value. For example setting the size to 5 will make the Select field 5 rows tall. This feature is useful if you enable Multiple to allow the website visitor to select multiple options.

First Row Placeholder

The first row placeholder is used to add a single option at the top of the drop-down list, such as Select. It is assigned no value, so if the website visitor does not select an option, the field will be considered empty.

WS Form variables can be entered into this field.

Help Text

The help text setting enables you to add smaller text under the field to assist the website visitor in completing that field.

As well as inserting plain text into this field, WS Form also provides extensive functionality for adding character and word count information. Click here to learn more about this functionality.

WS Form variables can be entered into this field.

Auto Complete

Web browsers sometimes have features for helping users fill forms in, for example pre-filling the user’s address based on earlier user input. The autocomplete content attribute can be used to hint to the web browser how to, or indeed whether to, provide such a feature.

Use this setting if you would like to specify the value of the autocomplete attribute. Use the off option to prevent auto complete on the field.

Select2 (PRO only)

Enable

Enabling Select2 will initialize the jQuery Select2 plugin on the select field. This provides users with the ability to search for options by typing a keyword. Learn more.

The default Select2 configuration settings in WS Form are:

  • Clearable Selections – Enabled.
  • Language – Set to WordPress locale.
  • Placeholder – Populated with Placeholder Row text.

If you wish to use a custom Select2 configuration, click here.

Use AJAX

When this setting is checked, WS Form will retrieve matching results via AJAX. This means that the options are not pre-loaded on the page which can improve page loading times for larger datasets.

Note that if you are using the Cascade Use AJAX option, this setting will not be available because the field is already using AJAX to retrieve data.

Show All If No Results

When this setting is checked, WS Form will show all results if no matching results are found.

Enable Tagging (Shown if Multiple checked)

When this setting is checked, Select2 will dynamically create new options from text input by the user in the search box.

Minimum Input Length

Minimum number of characters required to start a search.

Maximum Input Length

Maximum number of characters that may be provided for a search term.

Select2 Custom Messages (PRO only)

Input Too Short

Enter a custom message that is shown when the input is too short. Only shown if you have entered a Minimum Input Length setting.

Select2 Default: Please enter #char_remaining or more character#char_plural
Example: Input too short. Still need #char_remaining character#char_plural.

Input Too Long

Enter a custom message that is shown when the input is long short. Only shown if you have entered a Minimum Input Length setting.

Select2 Default: Please delete #char_over character#char_plural
Example: Input too long. Please delete #char_over character#char_plural.

Searching

Enter a custom message that is shown when Select2 is searching via AJAX.

Select2 Default: Searching…
Example: I am searching for #term, please wait.

No Results Found

Enter a custom message that is shown when no matching results are found.

Select2 Default: No results found
Example: There were no results.

Error Loading

Enter a custom message that is shown when an error occurs when loading the results.

Select2 Default: No results found
Example: An error occurred when loading the results.

Prefix / Suffix

The prefix and suffix settings allow you to add a prefix box and/or suffix box to the field.

WS Form - Prefix / Suffix

For example, you could add a unit of measure as a suffix, or an @ symbol as a prefix.

Accessibility

ARIA Label

Accessible Rich Internet Applications (ARIA) defines ways to make web content and web applications more accessible to people with disabilities.

This setting enables you to define what text is made available to ARIA applications. This would, for example, provide a screen reader with specific text to read to someone with a disability.

The value of this setting defaults to your field label. If you would like to change this, enter a new value.

WS Form variables can be entered into this field.

Exclusions

Exclude From Emails

By default, WS Form uses the #email_submission variable in email templates. This provides a simple way of displaying all of the submitted fields in emails. Sometimes there might be a need to exclude a field from an email, for example, you might want to not include some introductory copy on a form, or hide a field you’re using with conditional logic to show or hide an element.

To hide a field from emails, check this box.

Other WS Form add-ons may add exclusions in this section too, such as the WooCommerce add-on which allows you to exclude certain fields from the cart entries.

Hidden Behavior

Always Include in Actions

This setting allows you to change the behavior of a field if the hidden setting is checked (See above), or if you set a field as hidden using conditional logic.

The normal behavior for a field that has been hidden is that it will not be included if an action has a Clear Hidden Fields setting enabled. For example, if you have a Send Email action, WS Form will not include fields that are hidden.

If this setting is checked, this field will always be included in actions if it is hidden.

Advanced

The advanced tab contains additional form attribute settings that provide further control over how a field is rendered.

Styles

Use the Styles settings to change the design of the select field.

Label Position

There are five positions you can choose from for your label:

  • Default
  • Top
  • Left
  • Right
  • Bottom

The default position will place the label set in the form settings advanced tab. For new forms this will be the Top positioning.

Note that when using some frameworks some label positions may not be available.

Label Width

If your label position is set to left or right, you can specify how wide the label will be. You can consider the overall width of the label and the field to be 12 columns (or whatever value is set in Form Settings). By default, labels are rendered at 3 columns wide (1/4 width), which means the field itself is 9 columns wide (3/4 width). You can change the width of the label using this setting.

To change the default width of all labels in your form:

1. Click the form settings icon.
2. Click the Advanced tab.
3. Scroll down to Default Label Width and change the setting.
4. Click Save at the bottom.

Vertical Alignment

The vertical alignment option allows you to choose how this field will be vertically aligned in relation to fields in the same row. The options are:

  • Top
  • Middle
  • Bottom

Classes

For developers WS Form allows you to add your own classes to fields.

Field Wrapper

The wrapper CSS class setting enables you to add a class (or classes) to a field wrapper. Field wrappers are sections of HTML added around a field to position them on the page. To add multiple classes, add a space between the class names.

Field

To add a class to the actual field element itself, enter a class (or classes) to this setting. To add multiple classes, add a space between the class names.

Restrictions

Field restrictions enable you to define what can or cannot be entered into the field.

Disabled

If checked the field will be disabled, and it cannot be interacted with. You can re-enable a field dynamically by using conditional logic.

User Status

Choose from one of the options to filter which user status can see this field:

  • Any
  • Is Logged In
  • Is Logged Out
  • Has User Role or Capability

If you choose Has User Role or Capability, additional settings will appear that enable you to choose one or more roles or capabilities.

Duplicates

No Duplicates in Repeatable Sections

This setting only applies to select fields that are within a repeatable section. It prevents the same option from being selected across multiple repeatable section rows. For example, if you had a select field with t-shirt sizes and selected Small in the first row, then the Small option will be disabled in all other rows.

Validation

Show Invalid Feedback

Invalid feedback text is shown when a form is saved or submitted, and the field has not been completed according to the field settings you have configured. For example if the minimum character count is 10 and you enter 5 characters and then submit the form, the field will be deemed invalid. If this setting is checked, invalid feedback is shown under the field.

Invalid Feedback Text

WS Form automatically builds invalid feedback text for all of your fields. If no text is entered into this field, the value shown in the field in light gray text will be shown. If you would like to specify alternative invalid feedback text, you can enter it within this setting.

WS Form variables can be entered into this field.

Custom Attributes

This setting is used to add custom attributes to the HTML of this field, such as data-my-attribute="1234". You can add as many custom attributes as you need.

To add a custom attributes key value pair:

  1. Click the Add  icon to add a custom attribute row.
  2. Enter the key in the left column.
  3. Enter the value in the right column.
  4. Click Save to save the custom attributes.

Breakpoints

The breakpoint settings define the width of a field and also what the offset (how many columns from the left-hand side of the form or the previous field) of a field is for each breakpoint. For more information about the breakpoint settings and capabilities of WS Form, click here.

Options

The options in the Select drop-down are configured in this tab. Options are added using the data grid feature of WS Form. Data grids make entering lists of information quick and easy.

Using the data grid, you can mark a row as selected, disabled, or hidden.  You can also create opt-groups which allow you to group options together. For example this feature could be used to split a country list into continents.

For more information about using WS Form data grids, click here.

Column Mapping

Label

Choose the column in your data grid that contains the labels to be shown to the user when they are viewing your form.

Value

Choose the column in your data grid that contains unique values to used. This is the value that is saved to the submission.

Action Variables

Choose the column in your data grid that is used when you use variables such as #field or #email_submission when used in actions (e.g. Send Email).

Cascading

Cascading allows you to filter the options available in your select field by using the value of another field on your form. An example application of this feature would be to filter a select pull down of vehicle models by another select field containing vehicle makes.

Cascade

Check this setting to enable the cascading feature on this field.

Filter Column

The filter column setting allows you to choose which column of your data grid you want your options to be filtered by. In most cases you will want to create a new column that contains values you want to filter by.

Filter Value

The filter value setting allows you to choose which field on your form to filter your select options by in the filter column.

The following field types can be used for the filter value:

WS Form uses the Value column mapping of select, checkbox and radio fields for the filter value.

You should ensure that the value(s) returned by the Filter Value field match the values in your Filter Column exactly (Case sensitive).

No Results Placeholder

If no results are found, then this placeholder will be shown in the select field. This defaults to Select… but you can change this to anything you wish, e.g. Select Make

Show All If No Results

Enable this setting if you want WS Form to show all available results if no matching results are found.

Use AJAX

For larger datasets this setting can considerably speed up page loading times and filtering operations. With this setting enabled, WS Form will:

  • No longer include the select data in your initial page load, thus reducing your initial page load time.
  • Make an AJAX request and filter the results server-side each time the filter value is changed.

Loading Placeholder

This placeholder is shown in the select field while the AJAX process is retrieving records. This defaults to Loading… but you can change this to anything you wish, e.g. Retrieving Records.