abs0 has asked for the wisdom of the Perl Monks concerning the following question:
I've had a few web apps where I needed to present a list of options and show the selected option. Low volume sites, so all very easy to do with Template and something like:
<select name="whatever"> [% FOREACH option = whatever_options %] <option value="[% option.value %]" [% IF whatever == option.value %] selected="1" [% END %]> [% option.name %]</option> [% END %] </select>
Now I've hit a case where I have a <select multi="1"> dialog, so obviously the above Does Not Work.
In perl I have a list of objects representing the possible values (lets say categories), and another list representing the values selected for the current viewed object (lets say an article).
Some paths:
I *have* to generate a sane single list and pass to Template, anything else is wrong, but I'm unsure as to the best way to deal with this.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: populating <select multi="1"> from ORM
by merlyn (Sage) on Jul 05, 2007 at 19:47 UTC | |
by abs0 (Beadle) on Jul 09, 2007 at 17:40 UTC | |
|
Re: populating <select multi="1"> from ORM
by siracusa (Friar) on Jul 06, 2007 at 01:37 UTC |