diff options
Diffstat (limited to 'httemplate/elements/select.html')
-rw-r--r-- | httemplate/elements/select.html | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/httemplate/elements/select.html b/httemplate/elements/select.html index 67ef51418..42cd89504 100644 --- a/httemplate/elements/select.html +++ b/httemplate/elements/select.html @@ -1,9 +1,36 @@ +<%doc> +<& select.html, + # required + field => 'myfield', # NAME property + curr_value => 'foo', + labels => { # or 'option_labels' + 'AL' => 'Alabama', + 'AK' => 'Alaska', + 'AR' => 'Arkansas', + }, + options => [ 'AL', 'AK', 'AR' ], + curr_value => $cgi->param('myfield'), + + # recommended + id => 'myid', # DOM id + + # optional + size => 1, # to show multiple rows at once + style => '', # STYLE property + multiple => 0, + disabled => 0, + onchange => 'do_something()', + js_only => 0, # disables the whole thing +&> +</%doc> + % unless ( $opt{'js_only'} ) { <SELECT NAME = "<% $opt{field} %>" ID = "<% $opt{id} %>" previousValue = "<% $curr_value %>" previousText = "<% $labels->{$curr_value} || $curr_value %>" + <% $multiple %> <% $size %> <% $style %> <% $opt{disabled} %> @@ -74,4 +101,6 @@ my $style = scalar(@style) ? 'STYLE="'. join(';', @style). '"' : ''; my $size = $opt{'size'} ? 'SIZE='.$opt{'size'} : ''; +my $multiple = $opt{'multiple'} ? 'MULTIPLE' : ''; + </%init> |