summaryrefslogtreecommitdiff
path: root/httemplate/elements/select-region.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-region.html
parent11c9b2c65cc3c96ce86367ed1ca7e4bc24a4305d (diff)
slightly better error reporting for DID selector, from #39914
Diffstat (limited to 'httemplate/elements/select-region.html')
-rw-r--r--httemplate/elements/select-region.html10
1 files changed, 8 insertions, 2 deletions
diff --git a/httemplate/elements/select-region.html b/httemplate/elements/select-region.html
index 7ed959269..46c37c935 100644
--- a/httemplate/elements/select-region.html
+++ b/httemplate/elements/select-region.html
@@ -27,6 +27,7 @@
function <% $opt{'prefix'} %>update_regions(regions) {
+ var reply = JSON.parse(regions);
// blank the current region
for ( var i = what.form.<% $opt{'prefix'} %>region.length; i >= 0; i-- )
what.form.<% $opt{'prefix'} %>region.options[i] = null;
@@ -42,7 +43,7 @@
% }
// add the new regions
- var regionArray = eval('(' + regions + ')' );
+ var regionArray = reply.regions;
for ( var s = 0; s < regionArray.length; s++ ) {
var regionLabel = regionArray[s];
if ( regionLabel == "" )
@@ -57,6 +58,11 @@
} else {
var regionerror = document.getElementById('<% $opt{'prefix'} %>regionerror');
regionerror.style.display = 'inline';
+ if ( reply.error ) {
+ regionerror.textContent = reply.error;
+ } else {
+ regionerror.textContent = 'Select a different state';
+ }
}
//run the callback
@@ -73,7 +79,7 @@
<DIV ID="<% $opt{'prefix'} %>regionwait" STYLE="display:none"><IMG SRC="<%$fsurl%>images/wait-orange.gif"> <B>Finding regions</B></DIV>
-<DIV ID="<% $opt{'prefix'} %>regionerror" STYLE="display:none"><IMG SRC="<%$fsurl%>images/cross.png"> <B>Select a different state</B></DIV>
+<DIV ID="<% $opt{'prefix'} %>regionerror" STYLE="display:none; font-weight: bold"><IMG SRC="<%$fsurl%>images/cross.png"></DIV>
<SELECT NAME="<% $opt{'prefix'} %>region" onChange="<% $opt{'prefix'} %>region_changed(this); <% $opt{'onchange'} %>" <% $opt{'disabled'} %>>
<OPTION VALUE="">Select region</OPTION>