4.x style
[freeside.git] / httemplate / elements / select-country.html
index 724afe3..2868267 100644 (file)
@@ -40,6 +40,8 @@ Example:
     }
   
     function <% $pre %>country_changed(what, callback) {
+
+      what.form.<% $pre %>state.disabled = 'disabled';
   
       country = what.options[what.selectedIndex].value;
   
@@ -61,6 +63,8 @@ Example:
                 stateLabel = <% $opt{state_empty_label} || '(n/a)' |js_string %>;
             opt(what.form.<% $pre %>state, statesArray[s], stateLabel);
         }
+
+        what.form.<% $pre %>state.disabled = '';
   
         //run the callback
         if ( callback != null ) {
@@ -87,15 +91,13 @@ Example:
 >
 
 % unless ( $opt{'disable_empty'} ) {
-    <OPTION VALUE=""><% $opt{'empty_label'} || '(all)' %>
+    <OPTION VALUE=""><% $opt{'empty_label'} || '(all)' %></OPTION>
 % }
 
 % foreach my $country ( @all_countries ) {
-
-  <OPTION VALUE="<% $country |h %>"
-          <% $country eq $opt{'country'} ? ' SELECTED' : '' %>
-  ><% code2country($country). " ($country)" %>
-
+  <OPTION VALUE="<% $country |h %>"<% $country eq $opt{'country'} ? ' SELECTED' : '' %>>
+    <% FS::geocode_Mixin->code2country($country). " ($country)" |h %>
+  </OPTION>
 % } 
 
 </SELECT>
@@ -126,7 +128,7 @@ my $default = $conf->config('countrydefault') || 'US';
 
 my @all_countries = ( 
                       sort {    ($b eq $default) <=> ($a eq $default)
-                             or code2country($a) cmp code2country($b)
+                             or FS::geocode_Mixin->code2country($a) cmp FS::geocode_Mixin->code2country($b)
                            }
                       map  { $_->country } 
                            qsearch({