summaryrefslogtreecommitdiff
path: root/httemplate/elements/select-state.html
diff options
context:
space:
mode:
authorivan <ivan>2008-06-28 23:03:10 +0000
committerivan <ivan>2008-06-28 23:03:10 +0000
commit9c7dee35f91a386fcce14cb6c3e9d23ba3eee8af (patch)
treeb21b3ca250947289caaecdeba659bc37257bf464 /httemplate/elements/select-state.html
parenta1871d3d13c1dafa93b956762c0d23728d261da7 (diff)
get DIDs from globalpops
Diffstat (limited to 'httemplate/elements/select-state.html')
-rw-r--r--httemplate/elements/select-state.html24
1 files changed, 24 insertions, 0 deletions
diff --git a/httemplate/elements/select-state.html b/httemplate/elements/select-state.html
new file mode 100644
index 000000000..4f1c056b5
--- /dev/null
+++ b/httemplate/elements/select-state.html
@@ -0,0 +1,24 @@
+<SELECT NAME="<% $opt{'prefix'} %>state" onChange="<% $opt{'prefix'} %>state_changed(this); <% $opt{'onchange'} %>" <% $opt{'disabled'} %>>
+
+% if ($opt{empty}) {
+ <OPTION VALUE=""<% $opt{state} eq '' ? ' SELECTED' : '' %>><% $opt{empty} %>
+% }
+
+% foreach my $state ( keys %states ) {
+
+ <OPTION VALUE="<% $state %>"<% $state eq $opt{'state'} ? ' SELECTED' : '' %>><% $states{$state} || '(n/a)' %>
+
+% }
+
+
+</SELECT>
+
+<%init>
+my %opt = @_;
+foreach my $opt (qw( county state country prefix onchange disabled empty )) {
+ $opt{$_} = '' unless exists($opt{$_}) && defined($opt{$_});
+}
+
+tie my %states, 'Tie::IxHash', states_hash( $opt{'country'} );
+</%init>
+