X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Felements%2Fselect-phonenum.html;h=dd1b847361887b3631b5c499802bb758ee746994;hb=081638aa4a483577a9c5bc7ac9ea518370cf2381;hp=118fe4901609869453d46bb90e2160546f075ed9;hpb=fcb43580b83129097a2abf53104ca29f3185d44b;p=freeside.git 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'} ) { - + % }