Jump to content

state dropdown


generic

Recommended Posts

  • 1 month later...

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>

Link to comment
Share on other sites

  • 4 weeks later...

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated