combine ticket notification scrips, #15353
[freeside.git] / httemplate / elements / select-country.html
index c4368c2..e5656dc 100644 (file)
@@ -13,7 +13,7 @@ Example:
     disable_empty => 1, #defaults to 1, disable the empty option
     empty_label   => 'all', #label for empty option
     disable_stateupdate => 0, #bool - disabled update of the select-state.html
-    
+    style         => [ 'attribute:value', 'another:value' ],
   );
 
 </%doc>
@@ -53,8 +53,11 @@ Example:
         }
   
         //run the callback
-        if ( callback != null ) 
+        if ( callback != null ) {
           callback();
+        } else {
+          <% $pre %>state_changed(what.form.<% $pre %>state);
+        }
       }
   
       // go get the new states
@@ -70,6 +73,7 @@ Example:
         ID       = "<% $pre %>country"
         onChange = "<% $onchange %>"
         <% $opt{'disabled'} %>
+        <% $style %>
 >
 
 % unless ( $opt{'disable_empty'} ) {
@@ -101,6 +105,12 @@ my $onchange =
   ( $opt{'disable_stateupdate'} ? '' : $pre.'country_changed(this); ' ).
   $opt{'onchange'};
 
+$opt{'style'} ||= [];
+my $style =
+  scalar(@{$opt{style}})
+    ? 'STYLE="'. join(';', @{$opt{style}}). '"'
+    : '';
+
 my $conf = new FS::Conf;
 my $default = $conf->config('countrydefault') || 'US';