Advanced Tutorial - Dynamic List Generation
This feature has been deprecated. Please use Conditional Display of Responses.
Response lists can be generated dynamically based on previous selections in a questionnaire.
Instructions:
- Create your first question and responses. The question can be Single choice, Weighted score, Single list, or Combo box.
- Create your second question on a different page. This will be the question with the dynamically generated responses. The question type can be either Single list or Multiple list.
- Select the option Load responses from server-side script and type in your script. It will look something like this:
<% value1={STATE}; %>
<%report counties.asc STATE=$value1 %>
<option <
%= STATE eq {CODE} ? 'SELECTED' %> value={CODE}>{LABEL}</option>
</report>
|
Where STATE is the field name of the first question and counties.asc (ASCII file) is the name of the response list file
- Create a response list file called counties.asc. It needs to be tab delimited and there needs to be columns named STATE, CODE, and LABEL. It should look something like this:
STATE | CODE | LABEL |
AL | 1 | Autauga County |
AL | 2 | Baldwin County |
AL | 3 | Barbour County |
AS | 68 | Aleutians East Borough |
AS | 69 | Aleutians West |
AS | 70 | Anchorage Borough |
CA | 95 | Alameda County |
CA | 96 | Alpine County |
CA | 97 | Amador County |
FL | 153 | Alachua County |
FL | 154 | Baker County |
FL | 155 | Bay County |
WA | 220 | Adams County |
WA | 221 | Asotin County |
WA | 222 | Benton County |
CODE is the field name, LABEL is the field text, and STATE is the query value.
- Publish your web form and upload the ASCII file the rest of your web files.
See also...