Does anyone have example code of a <select> form element whose option can be
set via an association to the $cgi (query) object? e.g. if my template
snippet that builds the select box looks like:
<select name="typeof" multiple size=4>
<TMPL_LOOP NAME="options">
<option
value="<TMPL_VAR NAME="value">"
<TMPL_IF NAME="selected">
selected
</TMPL_IF>
>
<TMPL_VAR NAME="text">
</TMPL_LOOP>
</select>
And my param looks like:
$template->new(..., associate=>[$cgi] );
$template->param(options => [ {value=>1,text=>'case 1'},
{value=>2,text=>'case 2',selected=>1},
{value=>3,text=>'case 3',selected=>1),
],
);
Is there a technique I can use to get the options selected correctly based
on the $cgi->param('typeof') list? I have working code, but it seems rather
clunky--like there should be a more elegant solution. Am I missing a way to
setup the template, or manipulate params so the associate with $cgi works
directly?
Much thanks,
Matt
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]