We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 45950
    • 40 Posts
    I'm wanting to use the formitstate and formitcountry options. Is it possible that when a user selects a country that the appropriate state options would appear?

    So if I select Canada as the country, a list of provinces instead of US states would appear?
    or at the very least if another country, other than US is selected it would just display an input box instead of the US state options.
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      That would be done in Javascript. Well, it could be done in PHP, but it would require a lot of page reloading.

      I've actually used sites that when you changed the country selection it re-loads the page with the state field removed, but usually by that time I've already started to fill out something else, which gets lost in the page refresh. Very annoying.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 45950
        • 40 Posts
        thanks... will just put a state text field...
          • 14214
          • 299 Posts
          It's been a while, but this is what I have used for a few projects: http://bdhacker.sourceforge.net/javascript/countries/
            • 45950
            • 40 Posts
            jisacc - Thanks! will look into it...