Dynamic Server Page multiple select options only shows first element in target dsp page

I have following index.dsp:

    <select name="selectedOptions" multiple>
       <option value="0">0</option>
       <option value="1">1</option>
       <option value="2">2</option>
    </select>
    <input type=submit value="Submit"/>

And the result.dsp is as following:

Result Page

%loop selectedOptions%
Index=%value $index%:Value=%value selectedOptions%

%endloop%


Although the URL address shows selectedOptions=1&selectedOptions=2 as parameter name/value pairs being passed, the result.dsp only displays the first element.

What am I missing?

DSP will always create two fields for each field from the form:
fieldname contain the first value, as string type
fieldnameList contain all the values if there are more than one, as string array
in the pipeline.

So, you can change your code to:

%loop selectedOptionsList%
Index=%value $index%:Value=%value selectedOptionsList%

%endloop%

1 Like

I love you Tong :stuck_out_tongue: You saved my day!

It’s my pleasure!