diff options
author | Ivan Kohler <ivan@freeside.biz> | 2017-05-22 18:33:28 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2017-05-22 18:33:28 -0700 |
commit | cb2a5cbe1fb5f0b3fb8bea31f310f5805e5667c5 (patch) | |
tree | 5e46e184935e537999b5d49a9e399e47727ca0ba /httemplate/elements/select-phonenum.html | |
parent | 7dd7870cac67454c84c1dc3b3003a64a61b3451f (diff) |
fix DID selection dropdowns, RT#75901
Diffstat (limited to 'httemplate/elements/select-phonenum.html')
-rw-r--r-- | httemplate/elements/select-phonenum.html | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/httemplate/elements/select-phonenum.html b/httemplate/elements/select-phonenum.html index dd1b84736..c9254ad60 100644 --- a/httemplate/elements/select-phonenum.html +++ b/httemplate/elements/select-phonenum.html @@ -37,10 +37,9 @@ passing the exchange (or region) and <SCRIPT TYPE="text/javascript"> - function opt(what,value,text) { + function jopt(what,value,text) { var optionName = new Option(text, value, false, false); - var length = what.length; - what.options[length] = optionName; + what.append(optionName); } function <% $opt{'prefix'} %><% $previous %>_changed(what, callback) { @@ -58,12 +57,11 @@ passing the exchange (or region) and var reply = JSON.parse(phonenums); // blank the current phonenum - for ( var i = what.form.<% $opt{'prefix'} %>phonenum.length; i >= 0; i-- ) - what.form.<% $opt{'prefix'} %>phonenum.options[i] = null; + $('#<% $opt{prefix} %>phonenum').empty; % if ($opt{empty}) { if ( what.form.<% $opt{'prefix'} %>phonenum.type != 'select-multiple' ){ - opt(what.form.<% $opt{'prefix'} %>phonenum, '', '<% $opt{empty} %>'); + jopt($('#<% $opt{'prefix'} %>phonenum'), '', '<% $opt{empty} %>'); } % } @@ -73,7 +71,7 @@ passing the exchange (or region) and var phonenumLabel = phonenumArray[s]; if ( phonenumLabel == "" ) phonenumLabel = '(n/a)'; - opt(what.form.<% $opt{'prefix'} %>phonenum, phonenumArray[s], phonenumLabel); + jopt($('#<% $opt{'prefix'} %>phonenum'), phonenumArray[s], phonenumLabel); } //var phonenumFormLabel = document.getElementById('<% $opt{'prefix'} %>phonenumlabel'); @@ -131,11 +129,10 @@ passing the exchange (or region) and what = document.getElementById('<% $opt{prefix} %>phonenum'); // blank the current phonenum - for ( var i = what.form.<% $opt{'prefix'} %>phonenum.length; i >= 0; i-- ) - what.form.<% $opt{'prefix'} %>phonenum.options[i] = null; + $('#<% $opt{prefix} %>phonenum').empty; % if ($opt{empty}) { - opt(what.form.<% $opt{'prefix'} %>phonenum, '', '<% $opt{empty} %>'); + jopt($('#<% $opt{'prefix'} %>phonenum'), '', '<% $opt{empty} %>'); % } // add the new phonenums @@ -144,7 +141,7 @@ passing the exchange (or region) and var phonenumLabel = phonenumArray[s]; if ( phonenumLabel == "" ) phonenumLabel = '(n/a)'; - opt(what.form.<% $opt{'prefix'} %>phonenum, phonenumArray[s], phonenumLabel); + jopt($('#<% $opt{'prefix'} %>phonenum'), phonenumArray[s], phonenumLabel); } what.form.<% $opt{'prefix'} %>phonenum.disabled = ''; |