X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Felements%2Fselect-phonenum.html;h=18abe3dea29068f44cd07c874cc2bb71fd970aa8;hb=a72a10f754f7465121d6137bb3dcee0a21ea6443;hp=25a885a396adc96bed68c50d4e31562dd5fe3c5b;hpb=1e1d4445682c0e69781654ea7f2851d861031e9f;p=freeside.git diff --git a/httemplate/elements/select-phonenum.html b/httemplate/elements/select-phonenum.html index 25a885a39..18abe3dea 100644 --- a/httemplate/elements/select-phonenum.html +++ b/httemplate/elements/select-phonenum.html @@ -12,7 +12,7 @@ what.options[length] = optionName; } - function <% $opt{'prefix'} %>exchange_changed(what, callback) { + function <% $opt{'prefix'} %><% $previous %>_changed(what, callback) { what.form.<% $opt{'prefix'} %>phonenum.disabled = 'disabled'; what.form.<% $opt{'prefix'} %>phonenum.style.display = 'none'; @@ -21,7 +21,7 @@ var phonenumerror = document.getElementById('<% $opt{'prefix'} %>phonenumerror'); phonenumerror.style.display = 'none'; - exchange = what.options[what.selectedIndex].value; + var thing = "<% $previous eq 'region' ? '_REGION ' : '' %>" + what.options[what.selectedIndex].value; function <% $opt{'prefix'} %>update_phonenums(phonenums) { @@ -30,7 +30,9 @@ what.form.<% $opt{'prefix'} %>phonenum.options[i] = null; % if ($opt{empty}) { - opt(what.form.<% $opt{'prefix'} %>phonenum, '', '<% $opt{empty} %>'); + if ( what.form.<% $opt{'prefix'} %>phonenum.type != 'select-multiple' ){ + opt(what.form.<% $opt{'prefix'} %>phonenum, '', '<% $opt{empty} %>'); + } % } // add the new phonenums @@ -82,7 +84,7 @@ } // go get the new phonenums - <% $opt{'prefix'} %>get_phonenums( exchange, <% $opt{'svcpart'} %>, <% $opt{'prefix'} %>update_phonenums ); + <% $opt{'prefix'} %>get_phonenums( thing, <% $opt{'svcpart'} %>, <% $opt{'prefix'} %>update_phonenums ); } @@ -124,13 +126,18 @@ % unless ( $opt{'tollfree'} ) { - + % } - + ID = "<% $opt{'prefix'} %>phonenum" + NAME = "<% $opt{'prefix'} %>phonenum" + <% $opt{'disabled'} %> +%# notonChange="<% $opt{'prefix'} %>phonenum_changed(this); <% $opt{'onchange'} %>" +> +% unless ( $opt{multiple} ) { + +% } <%init> @@ -139,4 +146,6 @@ my %opt = @_; $opt{disabled} = 'disabled' unless exists $opt{disabled}; +my $previous = $opt{'region'} ? 'region' : 'exchange'; +