X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Felements%2Fselect-phonenum.html;h=a8d9a7c3eb70d0cfcb55abd5be889688731afd10;hb=08d132eca6a97c3417dc0f13bb603f080bd0e222;hp=25a885a396adc96bed68c50d4e31562dd5fe3c5b;hpb=b5c4237a34aef94976bc343c8d9e138664fc3984;p=freeside.git diff --git a/httemplate/elements/select-phonenum.html b/httemplate/elements/select-phonenum.html index 25a885a39..a8d9a7c3e 100644 --- a/httemplate/elements/select-phonenum.html +++ b/httemplate/elements/select-phonenum.html @@ -12,16 +12,16 @@ 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'; var phonenumwait = document.getElementById('<% $opt{'prefix'} %>phonenumwait'); - phonenumwait.style.display = ''; + phonenumwait.style.display = 'inline'; 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 @@ -52,7 +54,7 @@ what.form.<% $opt{'prefix'} %>phonenum.style.display = ''; } else { var phonenumerror = document.getElementById('<% $opt{'prefix'} %>phonenumerror'); - phonenumerror.style.display = ''; + phonenumerror.style.display = 'inline'; } //run the callback @@ -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'; +