View Full Version : state dropdown
generic
12-23-06, 11:14 PM
would it be possible to implement a STATE dropdown box rather than a fill in text box (like you have on your system when i look at my account) for those of us in the us so we don't get new sign ups misspelling their state and causing cc processing errors?
That would only apply to US users though. If you wanted this you could add it to the template files but it wouldn't be appropriate for all users of the system.
Matt
generic
12-23-06, 11:39 PM
ok, i will add it to the template and post the code here for others to use if they wish.
generic
02-17-07, 05:51 PM
here is what I came up with, but i cant get it to work.. I tried, probably something simple here...anyone see what the issue may be.
I cant get the state to stick from the first page where you enter it in.
when i used {$state} it would not even show the page. when i use just $state, it shows the page but wont pull the state variable from the previous page.
<select name="state">
<option value="Select a State" {php} if ($state == "") echo ' selected="selected"'; {/php}>Select a State</option>
<option {php} if ($state == "AK") echo ' selected="selected"'; {/php}>AK </option>
<option {php} if ($state == "AL") echo ' selected="selected"'; {/php}>AL </option>
<option {php} if ($state == "AR") echo ' selected="selected"'; {/php}>AR </option>
<option {php} if ($state == "AZ") echo ' selected="selected"'; {/php}>AZ </option>
<option {php} if ($state == "CA") echo ' selected="selected"'; {/php}>CA </option>
<option {php} if ($state == "CO") echo ' selected="selected"'; {/php}>CO </option>
<option {php} if ($state == "CT") echo ' selected="selected"'; {/php}>CT </option>
<option {php} if ($state == "DC") echo ' selected="selected"'; {/php}>DC </option>
<option {php} if ($state == "DE") echo ' selected="selected"'; {/php}>DE </option>
<option {php} if ($state == "FL") echo ' selected="selected"'; {/php}>FL </option>
<option {php} if ($state == "GA") echo ' selected="selected"'; {/php}>GA </option>
<option {php} if ($state == "HI") echo ' selected="selected"'; {/php}>HI </option>
<option {php} if ($state == "IA") echo ' selected="selected"'; {/php}>IA </option>
<option {php} if ($state == "ID") echo ' selected="selected"'; {/php}>ID </option>
<option {php} if ($state == "IL") echo ' selected="selected"'; {/php}>IL </option>
<option {php} if ($state == "IN") echo ' selected="selected"'; {/php}>IN </option>
<option {php} if ($state == "KS") echo ' selected="selected"'; {/php}>KS </option>
<option {php} if ($state == "KY") echo ' selected="selected"'; {/php}>KY </option>
<option {php} if ($state == "LA") echo ' selected="selected"'; {/php}>LA </option>
<option {php} if ($state == "MA") echo ' selected="selected"'; {/php}>MA </option>
<option {php} if ($state == "MD") echo ' selected="selected"'; {/php}>MD </option>
<option {php} if ($state == "ME") echo ' selected="selected"'; {/php}>ME </option>
<option {php} if ($state == "MI") echo ' selected="selected"'; {/php}>MI </option>
<option {php} if ($state == "MN") echo ' selected="selected"'; {/php}>MN </option>
<option {php} if ($state == "MO") echo ' selected="selected"'; {/php}>MO </option>
<option {php} if ($state == "MS") echo ' selected="selected"'; {/php}>MS </option>
<option {php} if ($state == "MT") echo ' selected="selected"'; {/php}>MT </option>
<option {php} if ($state == "NC") echo ' selected="selected"'; {/php}>NC </option>
<option {php} if ($state == "ND") echo ' selected="selected"'; {/php}>ND </option>
<option {php} if ($state == "NE") echo ' selected="selected"'; {/php}>NE </option>
<option {php} if ($state == "NH") echo ' selected="selected"'; {/php}>NH </option>
<option {php} if ($state == "NJ") echo ' selected="selected"'; {/php}>NJ </option>
<option {php} if ($state == "NM") echo ' selected="selected"'; {/php}>NM </option>
<option {php} if ($state == "NV") echo ' selected="selected"'; {/php}>NV </option>
<option {php} if ($state == "NY") echo ' selected="selected"'; {/php}>NY </option>
<option {php} if ($state == "OH") echo ' selected="selected"'; {/php}>OH </option>
<option {php} if ($state == "OK") echo ' selected="selected"'; {/php}>OK </option>
<option {php} if ($state == "OR") echo ' selected="selected"'; {/php}>OR </option>
<option {php} if ($state == "PA") echo ' selected="selected"'; {/php}>PA </option>
<option {php} if ($state == "RI") echo ' selected="selected"'; {/php}>RI </option>
<option {php} if ($state == "SC") echo ' selected="selected"'; {/php}>SC </option>
<option {php} if ($state == "SD") echo ' selected="selected"'; {/php}>SD </option>
<option {php} if ($state == "TN") echo ' selected="selected"'; {/php}>TN </option>
<option {php} if ($state == "TX") echo ' selected="selected"'; {/php}>TX </option>
<option {php} if ($state == "UT") echo ' selected="selected"'; {/php}>UT </option>
<option {php} if ($state == "VA") echo ' selected="selected"'; {/php}>VA </option>
<option {php} if ($state == "VT") echo ' selected="selected"'; {/php}>VT </option>
<option {php} if ($state == "WA") echo ' selected="selected"'; {/php}>WA </option>
<option {php} if ($state == "WI") echo ' selected="selected"'; {/php}>WI </option>
<option {php} if ($state == "WV") echo ' selected="selected"'; {/php}>WV </option>
<option {php} if ($state == "WY") echo ' selected="selected"'; {/php}>WY </option>
</select>
bucketshop
03-16-07, 03:15 AM
Actually what would be nice is to show the relevant information based on what was selected for the country.
If the US were selected, let the select's be states, if it were the UK, then show that information.
I have seen quite a order systems that do this and it is pretty slick.
xxkylexx
03-16-07, 03:35 AM
Some simple Javascript functions could make a switch on the fly depending on what country were selected, I imagine.
bucketshop
03-16-07, 11:25 AM
Kyle,
I think that is what they are doing. I will look around and see if I can find something like that.
bucketshop
03-16-07, 09:57 PM
Something like this would be nice:
http://javascript.internet.com/forms/country-state-drop-down.html
Powered by vBulletin® Version 4.2.1 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.