I've been able to make something like this work when both the value and text are the same, but not when they are different. Do you have a piece of Perl that can show me how you populate the params? Thanks
—Brad "The important work of moving the world forward does not wait to be done by perfect men." George Eliot
| [reply] |
my $options = {
23 => 'Text One',
36 => 'Text Two',
};
then you can look up the label for the current selection.
Since you have all these options in your program or database now, it is a bad idea to duplicate them in the HTML template again. And since a select group typically needs no design at all (and if so that should be CSS anyway), I am inclined to agree with Hero Zzyzzx and recommend creating the whole HTML for the select in your program (for example with CGI.pm) and stuffing it into the template as is.
(Of course, you can also eliminate the duplication by stuffing all the options into a tmpl_loop, but, as has been pointed out, this makes your template more complex than it needs to be)
| [reply] [d/l] |