You are viewing the Resources for the older version of JourneyApps (V3). JourneyApps V4 is the new default for all new apps since July 1, 2016.

All View Components → selectbox

Select a view component to see details on how it works:

selectbox

An input component that allows the user to select a single option from a list (if you are looking for an input component allowing the user to select multiple options, look at checklist).

Two types of selectboxes are available in JourneyApps:

Radio Selectbox Dropdown Selectbox

Example — Dropdown Selectbox

Code in View XML:

Appearance on mobile device:

Example — Radio Selectbox

Code in View XML:

Appearance on mobile device:

Configuration:

Option Required? Details
type optional How to render the selectbox:
  • dropdown for a dropdown selectbox
  • radio for radio buttons
Defaults to dropdown
bind required Variable/attribute in which to store the input value of the field.
Must be a variable or attribute of type enum
Note that the options displayed in the list are derived from the options defined for the enum specified here.
(see Attribute & Variable Types for more details)
label optional Text to display above the selectbox. It can be a Format String to make the text dynamic.
required optional true if this field must have a value when proceeding to another view. Defaults to false.
on‑change optional Function to call after a new value is selected.
show-if optional Controls whether the component is hidden or shown. The argument specified to show-if can either be a literal boolean value (true or false), or it can specify a variable, parameter or attribute that can be a string, number, object, etc. that evaluates to false or evaluates to true (see the section Show/Hide Components Dynamically for full details). If the component also specifies required="true", but it is hidden, the validation will be ignored/skipped.

hide-if optional The opposite of show-if (see above).