X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fcust_main%2Fselect-county.html;h=0dc8268969334a06f32b48f3b3c799a7330899b4;hb=a96ddd777a87c2f74a9cf408b44d0f6e7347b5f3;hp=c9b64bf4f43a0db728066b3b4f480cd499278744;hpb=c8cccb4a92adceb943c635fe62dad0d034462ce0;p=freeside.git diff --git a/httemplate/edit/cust_main/select-county.html b/httemplate/edit/cust_main/select-county.html index c9b64bf4f..0dc826896 100644 --- a/httemplate/edit/cust_main/select-county.html +++ b/httemplate/edit/cust_main/select-county.html @@ -16,8 +16,8 @@ function <% $opt{'prefix'} %>state_changed(what, callback) { - state = what.options[what.selectedIndex].text; - country = what.form.<% $opt{'prefix'} %>country.options[what.form.<% $opt{'prefix'} %>country.selectedIndex].text; + state = what.options[what.selectedIndex].value; + country = what.form.<% $opt{'prefix'} %>country.options[what.form.<% $opt{'prefix'} %>country.selectedIndex].value; function <% $opt{'prefix'} %>update_counties(counties) { @@ -34,6 +34,16 @@ opt(what.form.<% $opt{'prefix'} %>county, countiesArray[s], countyLabel); } + var countyFormLabel = document.getElementById('<% $opt{'prefix'} %>countylabel'); + + if ( countiesArray.length > 1 ) { + what.form.<% $opt{'prefix'} %>county.style.display = ''; + countyFormLabel.style.visibility = 'visible'; + } else { + what.form.<% $opt{'prefix'} %>county.style.display = 'none'; + countyFormLabel.style.visibility = 'hidden'; + } + //run the callback if ( callback != null ) callback(); @@ -47,14 +57,8 @@