X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Felements%2Ftr-checkbox-multiple.html;h=baf18f916e909b39c9957b2f2446aee34a6350a2;hp=bb90a820b2cacd6251556654b5ac2c6d0222fdec;hb=560af69840e7e3fcebf65d5d56ca4efc0851efec;hpb=0fb307c305e4bc2c9c27dc25a3308beae3a4d33c diff --git a/httemplate/elements/tr-checkbox-multiple.html b/httemplate/elements/tr-checkbox-multiple.html index bb90a820b..baf18f916 100644 --- a/httemplate/elements/tr-checkbox-multiple.html +++ b/httemplate/elements/tr-checkbox-multiple.html @@ -1,3 +1,23 @@ +<%doc> + +Display a containing multiple checkboxes + +USAGE: + +<& /elements/tr-checkbox-multipe.html, + label => emt('Label'), + field => 'field_name', + options => ['opt1', 'opt2'], + labels => { + opt1 => 'Option 1', + opt2 => 'Option 2', + }, + value => { + opt2 => '1', # opt2 defaults as checked + } +&> + + <% include('tr-td-label.html', @_ ) %> > @@ -33,6 +53,8 @@ my $onchange = $opt{'onchange'} my $value = $opt{'curr_value'} || $opt{'value'}; +$value = $opt{default_value} if $opt{default_value} && !defined($value); + my $labels = $opt{'option_labels'} || $opt{'labels'}; my $style = $opt{'cell_style'} ? 'STYLE="'. $opt{'cell_style'}. '"' : '';