X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Felements%2Fselect.html;h=3a0dc5b686e6b6a751c53b84c8379304625b0e28;hb=2a0b5339081a439a8c5ec1f2b9cd28b63fd3fa49;hp=efcf27b0e09ea5ee04ef8b177597629fc12d611a;hpb=99d1d8e1d4230097dbe5f00ca10241e74941d6e3;p=freeside.git diff --git a/httemplate/elements/select.html b/httemplate/elements/select.html index efcf27b0e..3a0dc5b68 100644 --- a/httemplate/elements/select.html +++ b/httemplate/elements/select.html @@ -1,12 +1,42 @@ +<%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 + element_etc => '', # anything else to put in the + <% $size %> <% $style %> <% $opt{disabled} %> <% $onchange %> + <% $opt{'element_etc'} %> > % if ( $opt{options} ) { @@ -71,5 +101,8 @@ my @style = ref($opt{'style'}) my $style = scalar(@style) ? 'STYLE="'. join(';', @style). '"' : ''; +my $size = $opt{'size'} ? 'SIZE='.$opt{'size'} : ''; + +my $multiple = $opt{'multiple'} ? 'MULTIPLE' : '';