X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Felements%2Fselect-country.html;h=e5656dc0c0ce4ab256487e2f580a1ce01c922ab3;hb=5fdd19665fb7c0ad425a99d3dbf9ad7e27fbf44a;hp=c4368c271ffa2bcb3ff39ca8aa134052f873be1c;hpb=d8cb6cd67cc574c90dbbfbd8db2da6711c516d65;p=freeside.git diff --git a/httemplate/elements/select-country.html b/httemplate/elements/select-country.html index c4368c271..e5656dc0c 100644 --- a/httemplate/elements/select-country.html +++ b/httemplate/elements/select-country.html @@ -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' ], ); @@ -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';