E-Commerce User Guide : Other setup scenarios : Configure the linking of the state and country dropdowns on the GuestEdit.aspx
 
Configure the linking of the state and country dropdowns on the GuestEdit.aspx
 
You can configure the MiscTables.xml file so that the Country dropdown that displays on the GuestEdit.aspx page is linked to the State dropdown. What this means is that when a Country is selected first, the State dropdown only lists those states linked to that country in Misctables.xml. This requires you to add a <FK>CountryName</FK> to each of the State/Provence entries in that file. Furthermore, you can add a Please Select line tailored for each “set of states” by adding a State entry with a value of XX, FK with a value of the desired country and a text value of, “Select a xxx” where xxx is a state, territory, province etc. To further enhance this functionality you could place Country before State on the GuestEdit.aspx page to suggest to the user that they select their country first which would thus filter the list of states displayed in the dropdown to the country selected. To enable this functionality add the following key to the site config file:
 
Site Admin Panel > Miscellaneous Settings > LinkedCountryState value = 1
 
Setting the value for this key to 0 disables this functionality.
 
Example:
This configures the Countries and States sections of the miscTables.xml file. This example works with countries USA and Canada:
 
<Countries>
<Country> <Value>XX</Value> <Text> Select Country </Text> </Country>
<Country> <Value>USA</Value> <Text>USA</Text> </Country>
<Country> <Value>CANADA</Value> <Text>CANADA</Text> </Country>
<Country> <Value>**</Value> <Text>Other:</Text> </Country>
</Countries>
<States>
<State> <Value>XX</Value> <Text>Select State</Text> <FK>USA</FK> </State>
<State> <Value>AL</Value> <Text>Alabama</Text> <FK>USA</FK> </State>
<State> <Value>AK</Value> <Text>Alaska</Text> <FK>USA</FK> </State>
<State> <Value>AZ</Value> <Text>Arizona</Text> <FK>USA</FK> </State>
<State> <Value>AR</Value> <Text>Arkansas</Text> <FK>USA</FK> </State>
<State> <Value>CA</Value> <Text>California</Text> <FK>USA</FK> </State>
<State> <Value>CO</Value> <Text>Colorado</Text> <FK>USA</FK> </State>
<State> <Value>CT</Value> <Text>Connecticut</Text> <FK>USA</FK> </State>
<State> <Value>DE</Value> <Text>Delaware</Text> <FK>USA</FK> </State>
<State> <Value>DC</Value> <Text>District of Columbia</Text> <FK>USA</FK> </State>
<State> <Value>FL</Value> <Text>Florida</Text> <FK>USA</FK> </State>
<State> <Value>GA</Value> <Text>Georgia</Text> <FK>USA</FK> </State>
<State> <Value>HI</Value> <Text>Hawaii</Text> <FK>USA</FK> </State>
<State> <Value>ID</Value> <Text>Idaho</Text> <FK>USA</FK> </State>
<State> <Value>IL</Value> <Text>Illinois</Text> <FK>USA</FK> </State>
<State> <Value>IN</Value> <Text>Indiana</Text> <FK>USA</FK> </State>
<State> <Value>IA</Value> <Text>Iowa</Text> <FK>USA</FK> </State>
<State> <Value>KS</Value> <Text>Kansas</Text> <FK>USA</FK> </State>
<State> <Value>KY</Value> <Text>Kentucky</Text> <FK>USA</FK> </State>
<State> <Value>LA</Value> <Text>Louisiana</Text> <FK>USA</FK> </State>
<State> <Value>ME</Value> <Text>Maine</Text> <FK>USA</FK> </State>
<State> <Value>MD</Value> <Text>Maryland</Text> <FK>USA</FK> </State>
<State> <Value>MA</Value> <Text>Massachusetts</Text> <FK>USA</FK> </State>
<State> <Value>MI</Value> <Text>Michigan</Text> <FK>USA</FK> </State>
<State> <Value>MN</Value> <Text>Minnesota</Text> <FK>USA</FK> </State>
<State> <Value>MS</Value> <Text>Mississippi</Text> <FK>USA</FK> </State>
<State> <Value>MO</Value> <Text>Missouri</Text> <FK>USA</FK> </State>
<State> <Value>MT</Value> <Text>Montana</Text> <FK>USA</FK> </State>
<State> <Value>NE</Value> <Text>Nebraska</Text> <FK>USA</FK> </State>
<State> <Value>NV</Value> <Text>Nevada</Text> <FK>USA</FK> </State>
<State> <Value>NH</Value> <Text>New Hampshire</Text> <FK>USA</FK> </State>
<State> <Value>NJ</Value> <Text>New Jersey</Text> <FK>USA</FK> </State>
<State> <Value>NM</Value> <Text>New Mexico</Text> <FK>USA</FK> </State>
<State> <Value>NY</Value> <Text>New York</Text> <FK>USA</FK> </State>
<State> <Value>NC</Value> <Text>North Carolina</Text> <FK>USA</FK> </State>
<State> <Value>ND</Value> <Text>North Dakota</Text> <FK>USA</FK> </State>
<State> <Value>OH</Value> <Text>Ohio</Text> <FK>USA</FK> </State>
<State> <Value>OK</Value> <Text>Oklahoma</Text> <FK>USA</FK> </State>
<State> <Value>OR</Value> <Text>Oregon</Text> <FK>USA</FK> </State>
<State> <Value>PA</Value> <Text>Pennsylvania</Text> <FK>USA</FK> </State>
<State> <Value>RI</Value> <Text>Rhode Island</Text> <FK>USA</FK> </State>
<State> <Value>SC</Value> <Text>South Carolina</Text> <FK>USA</FK> </State>
<State> <Value>SD</Value> <Text>South Dakota</Text> <FK>USA</FK> </State>
<State> <Value>TN</Value> <Text>Tennessee</Text> <FK>USA</FK> </State>
<State> <Value>TX</Value> <Text>Texas</Text> <FK>USA</FK> </State>
<State> <Value>UT</Value> <Text>Utah</Text> <FK>USA</FK> </State>
<State> <Value>VT</Value> <Text>Vermont</Text> <FK>USA</FK> </State>
<State> <Value>VA</Value> <Text>Virginia</Text> <FK>USA</FK> </State>
<State> <Value>WA</Value> <Text>Washington</Text> <FK>USA</FK> </State>
<State> <Value>WV</Value> <Text>West Virginia</Text> <FK>USA</FK> </State>
<State> <Value>WI</Value> <Text>Wisconsin</Text> <FK>USA</FK> </State>
<State> <Value>WY</Value> <Text>Wyoming</Text> <FK>USA</FK> </State>
<State> <Value>**</Value> <Text>Other:</Text> <FK>**</FK> </State>
<State> <Value>XX</Value> <Text>Select Province</Text> <FK>CANADA</FK> </State>
<State> <Value>AB</Value> <Text>Alberta</Text> <FK>CANADA</FK> </State>
<State> <Value>BC</Value> <Text>British Columbia</Text> <FK> CANADA </FK> </State>
<State> <Value>MB</Value> <Text>Manitoba</Text> <FK> CANADA </FK> </State>
<State> <Value>NB</Value> <Text>New Brunswick</Text> <FK> CANADA </FK> </State>
<State> <Value>NL</Value> <Text>Newfoundland</Text> <FK> CANADA </FK> </State>
<State> <Value>NT</Value> <Text>Northwest Territories</Text> <FK> CANADA </FK> </State>
<State> <Value>NS</Value> <Text>Nova Scotia</Text> <FK> CANADA </FK> </State>
<State> <Value>NU</Value> <Text>Nunavut</Text> <FK> CANADA </FK> </State>
<State> <Value>ON</Value> <Text>Ontario</Text> <FK> CANADA </FK> </State>
<State> <Value>PE</Value> <Text>Prince Edward Island</Text> <FK> CANADA </FK> </State>
<State> <Value>QC</Value> <Text>Quebec</Text> <FK> CANADA </FK> </State>
<State> <Value>SK</Value> <Text>Saskatchewan</Text> <FK> CANADA </FK> </State>
<State> <Value>YT</Value> <Text>Yukon</Text> <FK> CANADA </FK> </State>
</States>