X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Felements%2Fselect-areacode.html;h=612f03a8b0b7e079a0cc6045dfb055cb3ea9bd69;hp=f0f56d56dd4a7bce5017cc4f95e0ced45584cc4f;hb=ff27c3f36240aee48ed50153dd5d8fe3ac3f2443;hpb=3d0a1bb06b895c5be6e3f0517d355442a6b1e125 diff --git a/httemplate/elements/select-areacode.html b/httemplate/elements/select-areacode.html index f0f56d56d..612f03a8b 100644 --- a/httemplate/elements/select-areacode.html +++ b/httemplate/elements/select-areacode.html @@ -28,6 +28,7 @@ function <% $opt{'prefix'} %>update_areacodes(areacodes) { + var reply = JSON.parse(areacodes); // blank the current areacode for ( var i = what.form.<% $opt{'prefix'} %>areacode.length; i >= 0; i-- ) what.form.<% $opt{'prefix'} %>areacode.options[i] = null; @@ -47,7 +48,7 @@ % } // add the new areacodes - var areacodeArray = eval('(' + areacodes + ')' ); + var areacodeArray = reply.areacodes; for ( var s = 0; s < areacodeArray.length; s++ ) { var areacodeLabel = areacodeArray[s]; if ( areacodeLabel == "" ) @@ -62,6 +63,11 @@ } else { var areacodeerror = document.getElementById('<% $opt{'prefix'} %>areacodeerror'); areacodeerror.style.display = 'inline'; + if ( reply.error ) { + areacodeerror.textContent = reply.error; + } else { + areacodeerror.textContent = 'Select a different state'; + } } //run the callback @@ -78,7 +84,7 @@ - +