summaryrefslogtreecommitdiff
path: root/httemplate/elements
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate/elements')
-rw-r--r--httemplate/elements/radio.html19
-rw-r--r--httemplate/elements/tr-radio.html21
2 files changed, 40 insertions, 0 deletions
diff --git a/httemplate/elements/radio.html b/httemplate/elements/radio.html
new file mode 100644
index 000000000..9af533246
--- /dev/null
+++ b/httemplate/elements/radio.html
@@ -0,0 +1,19 @@
+<% $opt{'prefix'} %><INPUT TYPE = "radio"
+ NAME = "<% $opt{field} %>"
+ ID = "<% $opt{id}.'_'.$opt{value} %>"
+ 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>
diff --git a/httemplate/elements/tr-radio.html b/httemplate/elements/tr-radio.html
new file mode 100644
index 000000000..b5a2afaf1
--- /dev/null
+++ b/httemplate/elements/tr-radio.html
@@ -0,0 +1,21 @@
+% foreach my $option ( @{ $opt{options} } ) { #just arrayref for now
+
+ <% include('tr-td-label.html', @_, label=> $labels->{$option} || $option ) %>
+
+ <TD <% $style %>>
+ <% include('radio.html', @_, value=> $option ) %>
+ </TD>
+
+ </TR>
+
+% }
+<%init>
+
+my %opt = @_;
+
+my $labels = $opt{'option_labels'} || $opt{'labels'};
+
+my $style = $opt{'cell_style'} ? 'STYLE="'. $opt{'cell_style'}. '"' : '';
+
+</%init>
+