event refactor, landing on HEAD!
[freeside.git] / httemplate / elements / tr-checkbox.html
diff --git a/httemplate/elements/tr-checkbox.html b/httemplate/elements/tr-checkbox.html
new file mode 100644 (file)
index 0000000..2e6d1f1
--- /dev/null
@@ -0,0 +1,25 @@
+<% include('tr-td-label.html', @_ ) %>
+
+  <TD <% $style %>>
+    <INPUT TYPE  = "checkbox"
+           NAME  = "<% $opt{field} %>"
+           ID    = "<% $opt{id} %>"
+           VALUE = "<% $opt{value} %>"
+           <% $opt{curr_value} eq $opt{value} ? ' CHECKED' : '' %>
+           <% $onchange %>
+    >
+  </TD>
+
+</TR>
+
+<%init>
+
+my %opt = @_;
+
+my $onchange = $opt{'onchange'}
+                 ? 'onChange="'. $opt{'onchange'}. '(this)"'
+                 : '';
+
+my $style = $opt{'cell_style'} ? 'STYLE="'. $opt{'cell_style'}. '"' : '';
+
+</%init>