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;
% }
// 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 == "" )
} 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
% 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' : '' %>