Community Add-Ons

Add file to this package
Top » Features

auto state dropdowns depending on country
for osCommerce Online Merchant v2.2

We have a problem with some new customers failing to enter the proper state for their address. Apparently they don't enter a value for the state name that osCommerce can find in the zones database and therefore osCommerce returns an error message and a dropdown for the state with the state of Alabama being selected. Obviously the customers are not reading the error message and okay the "updated" address without noticing that the state they entered has been changed to Alabama.

To solve this problem I designed this modification so that osCommerce will display a dropdown list appropriate for each country, or a text input box if there are no zones defined for the selected country. As the country dropdown is changed so does the field for the state.

Legend:  Download   Report

Expand All / Collapse All

auto state dropdowns depending on country v1.2 17 Apr 2009  

While version 1.1 seems to have solved the problem caused by HTML characters in state names I decided that it would be safest to use the zone_id in the state dropdowns rather than the state name. That way no matter what kind of characters are in the state name the customer will still be able to select it from the drop down list without receiving an error message. Version 1.2 has also added the "Please Select" message to each state drop down menu so that new address entries will display the osCommerce "Please Select" message instead of the first state name in the list.

auto state dropdowns depending on country v1.1 8 Nov 2008  
auto state dropdowns depending on country 15 Oct 2008