diff options
author | Mark Wells <mark@freeside.biz> | 2016-03-28 17:36:25 -0700 |
---|---|---|
committer | Mark Wells <mark@freeside.biz> | 2016-03-28 17:36:32 -0700 |
commit | 79dc2b72b17acaa6aa19da6cd4f8c1b8a194a794 (patch) | |
tree | 00ab2f4ac6ba11483435a645f2963ebacfa9dd35 /httemplate/elements/select-phonenum.html | |
parent | 11c9b2c65cc3c96ce86367ed1ca7e4bc24a4305d (diff) |
slightly better error reporting for DID selector, from #39914
Diffstat (limited to 'httemplate/elements/select-phonenum.html')
-rw-r--r-- | httemplate/elements/select-phonenum.html | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/httemplate/elements/select-phonenum.html b/httemplate/elements/select-phonenum.html index 118fe4901..dd1b84736 100644 --- a/httemplate/elements/select-phonenum.html +++ b/httemplate/elements/select-phonenum.html @@ -56,6 +56,7 @@ passing the exchange (or region) and function <% $opt{'prefix'} %>update_phonenums(phonenums) { + 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; @@ -67,7 +68,7 @@ passing the exchange (or region) and % } // add the new phonenums - var phonenumArray = eval('(' + phonenums + ')' ); + var phonenumArray = reply.phonenums; for ( var s = 0; s < phonenumArray.length; s++ ) { var phonenumLabel = phonenumArray[s]; if ( phonenumLabel == "" ) @@ -86,6 +87,11 @@ passing the exchange (or region) and } else { var phonenumerror = document.getElementById('<% $opt{'prefix'} %>phonenumerror'); phonenumerror.style.display = 'inline'; + if ( reply.error ) { + phonenumerror.textContent = reply.error; + } else { + phonenumerror.textContent = 'Select a different <% $opt{'region'} ? 'region' : 'city/exchange' %>'; + } } //run the callback @@ -157,7 +163,7 @@ passing the exchange (or region) and % unless ( $opt{'tollfree'} ) { <DIV ID="phonenumwait" STYLE="display:none"><IMG SRC="<%$fsurl%>images/wait-orange.gif"> <B>Finding phone numbers</B></DIV> -<DIV ID="phonenumerror" STYLE="display:none"><IMG SRC="<%$fsurl%>images/cross.png"> <B>Select a different <% $opt{'region'} ? 'region' : 'city/exchange' %></B></DIV> +<DIV ID="phonenumerror" STYLE="display:none; font-weight: bold"><IMG SRC="<%$fsurl%>images/cross.png"></DIV> % } <SELECT <% $opt{multiple} ? 'MULTIPLE SIZE=25' : '' %> |