Skip navigation
All Places > Products > Questions
Log in to create and rate content, and to follow, bookmark, and share content with other members.
AnsweredAssumed Answered

Dynamic Country State Pick List feature not working

Question asked by 31491 on May 3, 2013
Latest reply on Nov 3, 2013 by 3bcff0e4dc20f30fc2b896ad6ed1f20c358a0617
I followed this to the letter:, but when I preview the landing page with this form, I see that the state field disappears, but choosing United States or Canada does not make it reappear. Also, I do not have progressive profiling enabled.

I've spent far too much time on this, have tried everything to get this to work. This landing page is not approved so you can't look at it, but I just wondered if anyone found anything funky about this feature, the instructions, or the zipped attachment list of countries, states, that makes it so it won't work. Or maybe you discovered some other way to make this work?

I also put the Custom HTML after the form, based on another page I read. It's so weird not being able to see and manipulate code.



    • 12850
      Hi Karen,

      I read through the article and made a test page without any issues and upon previewing the page I can select the US and the state field appears and when I choose another country it disappears without issue.

      Just to confirm, this is the code you pasted in the custom HTML element?

      <script type="text/javascript" src="/js/public/jquery-latest.min.js"></script>
      <script type="text/javascript" src="/js/public/stateCountry.js"></script>
      • 31491
        Yes, that's exactly the code I used. In fact, just for fun, I did it again using the code you posted here. I have redone this so many times, redid the state and country lists more than once, I'm so sick of looking at this form, but I need to make sure I am not missing anything. No matter what I do, I do see the state field disappear the second I preview the form, but it just won't reappear again when I choose United States or Canada. It's almost as though something is stopping it, like a browser thing, but I tried both IE and FireFox. This is so frustrating.
        • 12850
          Hmmm, you're right, that doesn't make sense. Which state/country lists did you copy/paste into the form?

          Would it be possible for you to post a link to the landing page for others to try out?
          • 31491
            I used the BasicCountries.rtf and basicStates.rtf.

            Here's the form:
            • 12850
              I'm not sure if this will make much of a difference, but I noticed that on the basicCountries .rtf file it starts with "Select Country: " where yours seems to start with "Select Country..."

              What if you change that in the form?
              • 12850
                Actually, I just opened up the fullCountries.rtf and that one seems to start with "Select Country..." Are you sure you didn't accidentally use that one?
                • 31491
                  It might. The first list I used (Both US and Canada) included those dots and I liked it. Then I changed to the basic one and didn't remove the dots. Perhaps I will.
                  • 31491
                    That was it! I guess I'll have to live without the dots for now. Thank you!
                    • 12850
                      Awesome! So glad it's finally working! You're welcome :)
                      • 40185
                        I am facing the same issue. State field simply dissappears and does not reappear when i select USA or canada as country. I followed all the steps exactly the way marketo article has mentioned.
                        @Karen can you please let me know what fix you made to the form that seemed to work for you. 
                        • 31491
                          I don't know if you've attempted to edit the list, but make sure you don't edit the list and that it starts like this: 

                          Select Country,United States::United States,Canada::Canada,Afghanistan::Afghanistan,Aland Islands::Aland Islands,Albania::Albania,Algeria::Algeria,American Samoa::American and so on...

                          Are you using Marketo landing pages or are you placing Marketo code on your own web pages?
                          • 40185
                            Thanks for your reply Karen. I am using marketo landing pages.
                            My list started like this: Select Country::,United States::United  - same goes for state
                            so i removed the two colons but it still doesn't look like it is working. 

                            • 31491
                              It shouldn't have the two colons after the word Country, just a comma, but the 2 colons do need to go after United States and Canada. You shouldn't have as much of a problem as I did since we are not using Marketo Landing Pages, and you are. Marketo has the JavaScript already on its pages. Let me know if this helped at all. 
                              • 3bcff0e4dc20f30fc2b896ad6ed1f20c358a0617
                                This is hosted on AWS and all you have to do is cut and paste a small script into a landing page or landing page template. On any form which contains country/state the values will automatically show up.


                                Hope it helps and we'll keep adding to it as more variations are required.