Multiple values in a listbox can be selected by holding the Ctrl key on the keyboard while clicking on the required values simultaneously.
When the form is submitted, the values selected in the listbox are recorded as a series of all selected choices separated by commas.
For example, assume that a listbox named States in a Submission Form contains names of all the different states in the United States.
If the following three states California, Nevada and Oregon are selected in this listbox, the value stored in that field will be "California,Nevada,Oregon". Implementation:
This solution can be used "as-is", without any changes if
a. It is used in an Submission Form DataPage and
b. The listbox field to enable multiple selection is called States.
To use this solution copy and paste the code below, inside the HTML Footer section of the DataPage using the Caspio Bridge DataPage Wizard.
/* "fieldName" is the variable name for the listbox type form element field. */
var fieldName = "InsertRecordStates";
To use this script with a field not named as States, change all occurrences of the text States in the script to the appropriate field name.
If the States field is used in the Search page of a Report DataPage, configure it as a Text Field with contains as its comparison operator. Only then, a search initiated with even one of the three state names will return all records where those state names are found, including those containing multiple state names.
# MS Windows - IE 8.0, Firefox 3.5.7, Chrome 18.104.22.168, Safari 4.0.3