summaryrefslogtreecommitdiff
path: root/httemplate/elements/select-exchange.html
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2016-03-28 17:36:25 -0700
committerMark Wells <mark@freeside.biz>2016-03-28 17:36:32 -0700
commit79dc2b72b17acaa6aa19da6cd4f8c1b8a194a794 (patch)
tree00ab2f4ac6ba11483435a645f2963ebacfa9dd35 /httemplate/elements/select-exchange.html
parent11c9b2c65cc3c96ce86367ed1ca7e4bc24a4305d (diff)
slightly better error reporting for DID selector, from #39914
Diffstat (limited to 'httemplate/elements/select-exchange.html')
-rw-r--r--httemplate/elements/select-exchange.html11
1 files changed, 9 insertions, 2 deletions
diff --git a/httemplate/elements/select-exchange.html b/httemplate/elements/select-exchange.html
index b9677094a..33def31b9 100644
--- a/httemplate/elements/select-exchange.html
+++ b/httemplate/elements/select-exchange.html
@@ -27,6 +27,7 @@
function <% $opt{'prefix'} %>update_exchanges(exchanges) {
+ var reply = JSON.parse(exchanges);
// blank the current exchange
for ( var i = what.form.<% $opt{'prefix'} %>exchange.length; i >= 0; i-- )
what.form.<% $opt{'prefix'} %>exchange.options[i] = null;
@@ -42,7 +43,7 @@
% }
// add the new exchanges
- var exchangeArray = eval('(' + exchanges + ')' );
+ var exchangeArray = reply.exchanges;
for ( var s = 0; s < exchangeArray.length; s++ ) {
var exchangeLabel = exchangeArray[s];
if ( exchangeLabel == "" )
@@ -57,6 +58,12 @@
} else {
var exchangeerror = document.getElementById('<% $opt{'prefix'} %>exchangeerror');
exchangeerror.style.display = 'inline';
+ if ( reply.error ) {
+ exchangeerror.textContent = reply.error;
+ } else {
+ exchangeerror.textContent = 'Select a different area code';
+ }
+
}
//run the callback
@@ -73,7 +80,7 @@
<DIV ID="exchangewait" STYLE="display:none"><IMG SRC="<%$fsurl%>images/wait-orange.gif"> <B>Finding cities / exchanges</B></DIV>
-<DIV ID="exchangeerror" STYLE="display:none"><IMG SRC="<%$fsurl%>images/cross.png"> <B>Select a different area code</B></DIV>
+<DIV ID="exchangeerror" STYLE="display:none; font-weight: bold"><IMG SRC="<%$fsurl%>images/cross.png"></DIV>
<SELECT NAME="<% $opt{'prefix'} %>exchange" onChange="<% $opt{'prefix'} %>exchange_changed(this); <% $opt{'onchange'} %>" <% $opt{'disabled'} %>>
<OPTION VALUE="">Select city / exchange</OPTION>