Question
Selecting items in a list from a multivalue field
I have an edit page that includes a menu form element that
allows multiple selections. It inserts all the IDs from a table
that it's got from a recordset as a string into field named
EventType separated by commas ("10000,10002,10004"). So far so
good.
I have a dynamic menu behaviour on the edit page too but when I reload it none of the options in the list are selected. It will mark an item in the menu as selected when there's only one value, presumably because when there are multiples the behaviour is trying to match a string of "10000,10002,10004" to the values in the the list , which are separate values:
<select name="EventType" size="5" multiple="multiple" id="EventType">
<option value="10001" >Abseil</option>
<option value="10007" >Golf</option>
<option value="10000" >Marathon/Run</option>
<option value="10008" >Other outdoor</option>
<option value="10003" >Overseas</option>
<option value="10005" >Social</option>
<option value="10006" >Triathlon</option>
<option value="10004" >Walking</option>
I'd have thought this would have been dealt with by the behaviour, but apparently not. How to I break apart the multivalue field to select each item in the menu?
I have a dynamic menu behaviour on the edit page too but when I reload it none of the options in the list are selected. It will mark an item in the menu as selected when there's only one value, presumably because when there are multiples the behaviour is trying to match a string of "10000,10002,10004" to the values in the the list , which are separate values:
<select name="EventType" size="5" multiple="multiple" id="EventType">
<option value="10001" >Abseil</option>
<option value="10007" >Golf</option>
<option value="10000" >Marathon/Run</option>
<option value="10008" >Other outdoor</option>
<option value="10003" >Overseas</option>
<option value="10005" >Social</option>
<option value="10006" >Triathlon</option>
<option value="10004" >Walking</option>
I'd have thought this would have been dealt with by the behaviour, but apparently not. How to I break apart the multivalue field to select each item in the menu?
