enable CardFortress in test database, #71513
[freeside.git] / httemplate / elements / select-phonenum.html
index 118fe49..dd1b847 100644 (file)
@@ -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' : '' %>