summaryrefslogtreecommitdiff
path: root/httemplate/elements/checkbox.html
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate/elements/checkbox.html')
-rw-r--r--httemplate/elements/checkbox.html19
1 files changed, 19 insertions, 0 deletions
diff --git a/httemplate/elements/checkbox.html b/httemplate/elements/checkbox.html
new file mode 100644
index 0000000..5176070
--- /dev/null
+++ b/httemplate/elements/checkbox.html
@@ -0,0 +1,19 @@
+<% $opt{'prefix'} %><INPUT TYPE = "checkbox"
+ NAME = "<% $opt{field} %>"
+ ID = "<% $opt{id} %>"
+ VALUE = "<% $opt{value} %>"
+ <% $opt{curr_value} eq $opt{value}
+ ? ' CHECKED'
+ : ''
+ %>
+ <% $onchange %>
+ ><% $opt{'postfix'} %>
+<%init>
+
+my %opt = @_;
+
+my $onchange = $opt{'onchange'}
+ ? 'onChange="'. $opt{'onchange'}. '(this)"'
+ : '';
+
+</%init>