diff options
Diffstat (limited to 'httemplate/elements')
-rw-r--r-- | httemplate/elements/select-table.html | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/httemplate/elements/select-table.html b/httemplate/elements/select-table.html index e7baaf53b..1a440f07e 100644 --- a/httemplate/elements/select-table.html +++ b/httemplate/elements/select-table.html @@ -64,8 +64,13 @@ Example: > % while ( @pre_options ) { - <OPTION VALUE="<% shift(@pre_options) %>"><% shift(@pre_options) %> - +% my $pre_opt = shift(@pre_options); +% my $pre_label = shift(@pre_options); +% my $selected = ( ref($value) && $value->{$pre_opt} ) +% || ( $value eq $pre_opt ); + <OPTION VALUE="<% $pre_opt %>" + <% $selected ? 'SELECTED' : '' %> + ><% $pre_label %> % } % unless ( $opt{'multiple'} || $opt{'disable_empty'} ) { |