NAME = "<% $opt{'element_name'} || $opt{'field'} || $key %>"
ID = "<% $opt{'id'} || $key %>"
<% $onchange %>
+ <% $size %>
<% $opt{'element_etc'} %>
>
<OPTION VALUE=""><% $opt{'empty_label'} || 'all' %>
% }
-% foreach my $record ( sort { $a->$name_col() cmp $b->$name_col()
-% || $a->$key() <=> $b->$key()
-% }
-% @records
+% foreach my $record (
+% # we have the order_by parameter for this
+% #sort { $a->$name_col() cmp $b->$name_col()
+% # || $a->$key() <=> $b->$key()
+% # }
+% @records
% )
% {
% my $recvalue = $record->$key();
my @records = ();
if ( $opt{'records'} ) {
- @records = @{ $opt{'records'} };
+ @records = sort { $a->get($name_col) cmp $b->get($name_col) }
+ @{ $opt{'records'} };
} else {
@records = qsearch( {
'table' => $opt{'table'},
my @pre_options = $opt{pre_options} ? @{ $opt{pre_options} } : ();
my @post_options = $opt{post_options} ? @{ $opt{post_options} } : ();
+my $size = $opt{'size'} ? 'SIZE=' . $opt{'size'} : '';
+
</%init>