diff options
Diffstat (limited to 'httemplate/elements')
-rw-r--r-- | httemplate/elements/select-areacode.html | 10 | ||||
-rw-r--r-- | httemplate/elements/select-exchange.html | 11 | ||||
-rw-r--r-- | httemplate/elements/select-phonenum.html | 10 | ||||
-rw-r--r-- | httemplate/elements/select-region.html | 10 |
4 files changed, 33 insertions, 8 deletions
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 @@ <DIV ID="areacodewait" STYLE="display:none"><IMG SRC="<%$fsurl%>images/wait-orange.gif"> <B>Finding area codes</B></DIV> -<DIV ID="areacodeerror" STYLE="display:none"><IMG SRC="<%$fsurl%>images/cross.png"> <B>Select a different state</B></DIV> +<DIV ID="areacodeerror" STYLE="display:none; font-weight: bold"><IMG SRC="<%$fsurl%>images/cross.png"></DIV> <SELECT NAME="<% $opt{'prefix'} %>areacode" onChange="<% $opt{'prefix'} %>areacode_changed(this); <% $opt{'onchange'} %>" <% $opt{'disabled'} %>> <OPTION VALUE="">Select area code</OPTION> diff --git a/httemplate/elements/select-exchange.html b/httemplate/elements/select-exchange.html index b9677094a..33def31b9 100644 --- a/httemplate/elements/select-exchange.html +++ b/httemplate/elements/select-exchange.html @@ -27,6 +27,7 @@ function <% $opt{'prefix'} %>update_exchanges(exchanges) { + var reply = JSON.parse(exchanges); // blank the current exchange for ( var i = what.form.<% $opt{'prefix'} %>exchange.length; i >= 0; i-- ) what.form.<% $opt{'prefix'} %>exchange.options[i] = null; @@ -42,7 +43,7 @@ % } // add the new exchanges - var exchangeArray = eval('(' + exchanges + ')' ); + var exchangeArray = reply.exchanges; for ( var s = 0; s < exchangeArray.length; s++ ) { var exchangeLabel = exchangeArray[s]; if ( exchangeLabel == "" ) @@ -57,6 +58,12 @@ } else { var exchangeerror = document.getElementById('<% $opt{'prefix'} %>exchangeerror'); exchangeerror.style.display = 'inline'; + if ( reply.error ) { + exchangeerror.textContent = reply.error; + } else { + exchangeerror.textContent = 'Select a different area code'; + } + } //run the callback @@ -73,7 +80,7 @@ <DIV ID="exchangewait" STYLE="display:none"><IMG SRC="<%$fsurl%>images/wait-orange.gif"> <B>Finding cities / exchanges</B></DIV> -<DIV ID="exchangeerror" STYLE="display:none"><IMG SRC="<%$fsurl%>images/cross.png"> <B>Select a different area code</B></DIV> +<DIV ID="exchangeerror" STYLE="display:none; font-weight: bold"><IMG SRC="<%$fsurl%>images/cross.png"></DIV> <SELECT NAME="<% $opt{'prefix'} %>exchange" onChange="<% $opt{'prefix'} %>exchange_changed(this); <% $opt{'onchange'} %>" <% $opt{'disabled'} %>> <OPTION VALUE="">Select city / exchange</OPTION> 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'} ) { <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' : '' %> 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> |