By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,199 Members | 1,458 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,199 IT Pros & Developers. It's quick & easy.

showing selected items in a multiple select menu

P: n/a

I have a form that has several multiple select menus. I would like to
save the multiple selections but be able to show them as selected
items when the form data is updated.

<select name="project_menu[]" size="4" multiple="multiple"
class="TabbedPanelsTabGroup" id="project_menu[]">
<option value="add">Add</option>
<option value="update">Update</option>
<option value="view">View</option>

I'm using a template to generate the form. Is there a checked option
that can be used to preselect the option when rendering the form much
like a value = "" option ?
Jun 27 '08 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On Fri, 27 Jun 2008 15:24:13 -0700 (PDT), Rowan wrote:
>
I have a form that has several multiple select menus. I would like to
save the multiple selections but be able to show them as selected
items when the form data is updated.

<select name="project_menu[]" size="4" multiple="multiple"
class="TabbedPanelsTabGroup" id="project_menu[]">
<option value="add">Add</option>
<option value="update">Update</option>
<option value="view">View</option>

I'm using a template to generate the form. Is there a checked option
that can be used to preselect the option when rendering the form much
like a value = "" option ?
You put a little snippet in that echos "selected" into the option tags
when something is true.

<option value="add" <?php if ($your_cond) {echo " selected ";}?>>Add</option>

--
For every subject you can think of there are at least 3 web sites.
The owners of these web sites know each other and at least one of
them hates at least one of the others.
-- mnlooney's view of Skif's Internet Theorem
Jun 28 '08 #2

P: n/a
Rowan wrote:
>

I have a form that has several multiple select menus. I would like to
save the multiple selections but be able to show them as selected
items when the form data is updated.

<select name="project_menu[]" size="4" multiple="multiple"
class="TabbedPanelsTabGroup" id="project_menu[]">
<option value="add">Add</option>
<option value="update">Update</option>
<option value="view">View</option>

I'm using a template to generate the form. Is there a checked option
that can be used to preselect the option when rendering the form much
like a value = "" option ?
Your template engine might provide a method of specifying the value of
the select.
Jun 29 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.