X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;ds=inline;f=httemplate%2Felements%2Ftr-checkbox-multiple.html;h=baf18f916e909b39c9957b2f2446aee34a6350a2;hb=560af69840e7e3fcebf65d5d56ca4efc0851efec;hp=bb90a820b2cacd6251556654b5ac2c6d0222fdec;hpb=b5c4237a34aef94976bc343c8d9e138664fc3984;p=freeside.git
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
+ }
+&>
+
+%doc>
<% 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'}. '"' : '';
|