summaryrefslogtreecommitdiff
path: root/httemplate/elements/select-tiered.html
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2012-02-27 10:31:47 -0800
committerMark Wells <mark@freeside.biz>2012-02-27 10:31:47 -0800
commiteb9d1063e1203231ee0c6922ea5638370f7b5ece (patch)
treee2d6781d7b0a9239c5e3deb98b27c694426f86c5 /httemplate/elements/select-tiered.html
parentcaba365bbebc7e73ad0c25f9a3a9c75a48ed6140 (diff)
allow svc_broadband to link directly to a router, #14698
Diffstat (limited to 'httemplate/elements/select-tiered.html')
-rw-r--r--httemplate/elements/select-tiered.html12
1 files changed, 9 insertions, 3 deletions
diff --git a/httemplate/elements/select-tiered.html b/httemplate/elements/select-tiered.html
index 35f9e5a60..99b285274 100644
--- a/httemplate/elements/select-tiered.html
+++ b/httemplate/elements/select-tiered.html
@@ -35,6 +35,7 @@ contain the following:
isn't fully tested.
- after: an HTML string to be inserted after the select element, before
the next one. By default there's nothing between them.
+- onchange: an additional javascript function to be called on change.
For convenience, "curr_value" and "field" can be passed as part of the
main argument list, and will be applied to the last tier.
@@ -43,8 +44,13 @@ main argument list, and will be applied to the last tier.
% $i = 0;
% foreach my $tier (@$tiers) {
% my $onchange;
-% $onchange="onchange='${pre}select_change(this, $i)'"
+% $onchange="${pre}select_change(this, $i)"
% if $i < scalar(@$tiers) - 1;
+%
+% $onchange .= ';'.$tier->{onchange}."(this, $i);"
+% if $tier->{onchange};
+%
+% $onchange = "onchange='$onchange'" if $onchange;
<SELECT
NAME="<% $tier->{field} %>"
ID="<% $pre."select_".$i %>"
@@ -54,7 +60,8 @@ main argument list, and will be applied to the last tier.
% if ( $i == 0 ) {
% my $options = $tiers_by_key->[0]->{''};
% foreach ( sort keys %$options ) {
- <OPTION VALUE="<%$_ |h%>"><% $options->{$_} |h%></OPTION>
+ <OPTION VALUE="<%$_ |h%>" <% $curr_values->[$i] eq $_ ? 'SELECTED' : ''%>>
+ <% $options->{$_} |h%></OPTION>
% }
% }
% $i++;
@@ -178,7 +185,6 @@ while($i >= 1) {
foreach my $key ( %{ $tier->{by_key} } ) {
my $options = $tier->{by_key}->{$key};
if ( exists( $options->{$curr_value} ) ) {
- warn "tier $i curr_value ($curr_value) found under key $key\n";
$tiers->[$i-1]->{curr_value} = $key;
last;
}