Results 1 to 8 of 8

Thread: state dropdown

  1. #1
    Join Date
    Dec 2006
    Posts
    655

    Default state dropdown

    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?

  2. #2
    Join Date
    Jul 2005
    Location
    UK
    Posts
    8,440

    Default

    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
    WHMCompleteSolution
    The Complete Client Management, Billing & Support Solution
    www.whmcs.com

  3. #3
    Join Date
    Dec 2006
    Posts
    655

    Default

    ok, i will add it to the template and post the code here for others to use if they wish.

  4. #4
    Join Date
    Dec 2006
    Posts
    655

    Default

    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.

    Code:
    <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>

  5. #5
    Join Date
    Mar 2007
    Posts
    89

    Default

    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.

  6. #6
    Join Date
    Apr 2006
    Location
    Jacksonville, FL
    Posts
    549

    Default

    Some simple Javascript functions could make a switch on the fly depending on what country were selected, I imagine.

  7. #7
    Join Date
    Mar 2007
    Posts
    89

    Default

    Kyle,

    I think that is what they are doing. I will look around and see if I can find something like that.

  8. #8
    Join Date
    Mar 2007
    Posts
    89

    Default

    Something like this would be nice:

    http://javascript.internet.com/forms...drop-down.html

Similar Threads

  1. State dropdown instead of textbox
    By jvriends in forum Feature Requests
    Replies: 5
    Last Post: 06-29-10, 04:08 PM
  2. Dropdown list state
    By citeglobe in forum Customisation & Integration Questions
    Replies: 1
    Last Post: 02-22-09, 12:17 AM
  3. state field
    By Adamski in forum Customisation & Integration Questions
    Replies: 18
    Last Post: 02-03-09, 05:07 PM