Desktop User Guides > Professional > Interview scripting > Interview scripting reference > Default templates > Default question template > Drop-down lists and list boxes
 
Drop-down lists and list boxes
Categorical response lists can be displayed as drop-down lists or list boxes. The HTML code for these types of response lists is as follows (the code in square brackets is present for list boxes but not drop-down lists):
<span style="display: inline-block;">
  <div></div>
  <select [size="number_of_lines" multiple=""] name="reference"
        class="list_type" style="margin-left: 1em;">
    <option style="" class="mrMultiple" [selected=""]
          value="name">label</option>
    ...
  </select>
</span>
where:
number_of_lines is the height of the list box. The default is 4. This parameter is omitted for drop-down lists which are always shown as a one-line box.
reference is the internal name that UNICOM Intelligence Interviewer - Server assigns to the list. This has the form _Qquestionname_C, where questionname is the question name.
list_type is either mrDropDown or mrListBox. If ListType is mrListBox, the multiple parameter is added to the specification to allow more than one answer to be chosen from the list.
name is the category name defined in the metadata.
label is the category label (response text) to display on the screen.
The selected="" attribute is present only when the question already has an answer (usually after a snapback or restart) and marks the respondent’s current answer. This causes that answer to be preselected when the question is displayed.
For example, the question:
MostFrequentTea "Which type of tea do you drink most frequently?"
style(control(type = "droplist")) categorical [1..1]
{
Assam, Darjeeling, Ceylon, China,
EnglishBreakfast "English Breakfast",
OtherTea "Other"
};
becomes:
<span class="mrQuestionText" style="">Which type of tea do you drink most frequently?</span>
<div><br/></div>
<div></div>
<span style="display: inline-block;">
<div></div>
<select name="_QMostFrequentTea_C" class="mrDropdown" style="margin-left: 1em;">
<option style="" class="mrMultiple" value="Assam">Assam</option>
<option style="" class="mrMultiple" value="Darjeeling">Darjeeling</option>
<option style="" class="mrMultiple" value="Ceylon">Ceylon</option>
<option style="" class="mrMultiple" value="China">China</option>
<option style="" class="mrMultiple" value="EnglishBreakfast">English Breakfast</option>
<option style="" class="mrMultiple" value="OtherTea">Other</option>
</select>
</span>
See also
Default question template