Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

The dreaded Multiselect form on input_form.html

Quote Reply
The dreaded Multiselect form on input_form.html
I've been trying to get multiple select forms working on my input_form template for ages. Just when I thought I had them beat I find another problem.

First I found that "ENUM" fields would not work with multiple select forms, and got things working using type "VARCHAR" or "TEXT". All seems well...

Next, I find the the multiple select form is not showing values on the modify.html template. Changing to "contains" instead of "eq" in the comparison displays selections on the modify page properly using the code below...

<select id="features" name="features" multiple="multiple" size=5>
<option value="None" <%if features contains 'None'%>selected<%endif%>>------None------</option>
<option value="Option1" <%if features contains 'Option1'%>selected<%endif%>>Option1</option>
<option value="Option2" <%if features contains 'Option2'%>selected<%endif%>>Option2</option>
<option value="Option3" <%if features contains 'Option3'%>selected<%endif%>>Option3</option>
</select>

The problem is, if there is an error made by users when adding or modifying a link the selections on the multiselect forms are lost. All except for the the values to the right, or rather the last one selected.

From the docs: "contains will be true if the variable contains the right-hand side."

Why would the code work on a the modify template, but not after an error???

Is there a way to fix this, or do I need give up and get started changing over to checkboxes???

Thanks
Subject Author Views Date
Thread The dreaded Multiselect form on input_form.html Jonze 4640 Mar 27, 2007, 7:47 PM
Post Re: [Jonze] The dreaded Multiselect form on input_form.html
VishalT 4573 Mar 27, 2007, 7:58 PM
Thread Re: [Jonze] The dreaded Multiselect form on input_form.html
brewt 4602 Mar 27, 2007, 8:11 PM
Thread Re: [brewt] The dreaded Multiselect form on input_form.html
Jonze 4551 Mar 28, 2007, 7:44 AM
Thread Re: [Jonze] The dreaded Multiselect form on input_form.html
Andy 4575 Mar 28, 2007, 8:24 AM
Thread Re: [Andy] The dreaded Multiselect form on input_form.html
Jonze 4537 Mar 28, 2007, 8:37 AM
Thread Re: [Jonze] The dreaded Multiselect form on input_form.html
Andy 4579 Mar 28, 2007, 8:44 AM
Post Re: [Andy] The dreaded Multiselect form on input_form.html
Jonze 4543 Mar 28, 2007, 9:02 AM
Post Re: [Andy] The dreaded Multiselect form on input_form.html
Jonze 4483 Mar 29, 2007, 11:42 AM
Thread Re: [Jonze] The dreaded Multiselect form on input_form.html
brewt 4522 Mar 28, 2007, 11:07 AM
Post Re: [brewt] The dreaded Multiselect form on input_form.html
Jonze 4528 Mar 28, 2007, 2:27 PM