iFormBuilder JavaScript Tips & Tricks
Table of Contents
- What is a Multi-Select element?
- What is an Option List?
- What are Dynamic Values?
- How do I pre-populate a Multi-Select element?
What is the Multi-Select element?
The Multi-Select element is similar to the Pick List element, except it allows users to select multiple items from the assigned option list.
Click here for instructions on how to add a Multi-Select element to your forms.
What is an Option List?
An Option List is just what it sounds like; a list of options the user can choose from when collecting data.
Click here for more information on how to use Option Lists.
What are Dynamic Values?
Dynamic Values are used to apply a value to an element based on specific conditions.
Click here for more information on Dynamic Values and how to implement them.
How do I pre-populate a Multi-Select element?
PLEASE NOTE: This functionality currently only works on the iOS app.
To pre-populate your Multi-Select element with certain options, please follow the instructions below.
STEP 1. From inside the form builder, with your Multi-Select element selected, scroll down to the Option List section and select Option Lists.
STEP 2. Identify the Key Values of your options. These will be used in the Javascript to pre-populate your Multi-Select element.
In this example, we'll be populating the element with team members Jon and Tak.
STEP 3. In the Dynamic Value field of the Multi-Select element (under Smart Controls), put the following Javascript:
["jon","tak"]
STEP 4. Save your form.
STEP 5. Test the functionality on your device.
PLEASE NOTE: Each new record created on the device will populate these two options by default.
Download the attached form package to use as an example.
Comments
0 comments
Please sign in to leave a comment.