field => 'myfield', # NAME property
curr_value => 'foo',
labels => { # or 'option_labels'
+ # note: these will be escaped for you, don't escape them
'AL' => 'Alabama',
'AK' => 'Alaska',
'AR' => 'Arkansas',
},
options => [ 'AL', 'AK', 'AR' ],
- curr_value => $cgi->param('myfield'),
+ curr_value => scalar( $cgi->param('myfield') ),
# recommended
id => 'myid', # DOM id
<SELECT NAME = "<% $opt{field} %>"
ID = "<% $opt{id} %>"
previousValue = "<% $curr_value %>"
- previousText = "<% $labels->{$curr_value} || $curr_value %>"
+ previousText = "<% $labels->{$curr_value} || $curr_value |h %>"
<% $multiple %>
<% $size %>
<% $style %>
<OPTION VALUE="<% $option %>"
<% $opt{curr_value} eq $option ? 'SELECTED' : '' %>
>
- <% $labels->{$option} || $option %>
+ <% $labels->{$option} || $option |h %>
</OPTION>
% }