Country and state/province fields on Forms | Community
Skip to main content
Richard_Wasylyn
Level 4
January 11, 2014
Question

Country and state/province fields on Forms

  • January 11, 2014
  • 14 replies
  • 5174 views
Does anyone know if you can have the state/province field set to have dependent picklists based on the country that is selected. For example, if the user selects Canada as a country, can only Canadia provinces show in the state/province field?

One step further can we have the state/province field visible only after the country is selected.

At this point I'm guessing that there isn't an easy way to do this within marketo that we'll likely need some javascript to handle this.

Does anyone have a similar set up that can provide some suggestions?
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

14 replies

January 11, 2014
Hey Richard,

"Dynamic States" are possible and pretty straightforward to set up. Here is a link to an article about how to do it: https://community.marketo.com/MarketoResource?id=kA650000000GtpdCAC



January 11, 2014
Hi Richard,

http://info.digital-pi.net/auto-country-state.html
It have a working example created by one of Marketo community member.


Richard_Wasylyn
Level 4
January 13, 2014
Quick question on the basic country file that is provided in the documentation. The file has "United States::US," for each country, would the country or the two character code populate the country field in our CRM? If I take out the two character country code would that cause any issues with the drop down?
Richard Wasylynchuk
Richard_Wasylyn
Level 4
January 13, 2014
I've managed to get the country and state/province fields working however, for some reason Newfoundland is showing up in the US state dropdown. It's also showing up in it's proper place in the Canadian provinces. Any ideas what might be going on here?
Richard Wasylynchuk
January 13, 2014
Hey Richard,

When you see "United States::US", you will see "United States" in the dropdown in the form, but once submitted, "US" will be the country. If you want "US" in the dropdown, but "United States" in your system, simply put "US::United States". If you want "US" in the dropdown and "US" in your system, simply put "US". The two colons let the system know what should be seen and what should be entered if selected. 

The easiest way to check is to copy the selections and paste in a word doc. Then, use Ctrl+f to search for "Newfoundland". My best guess is that somehow it was added twice. 

Let me know how it goes!
Level 1
January 17, 2014
I feel your pain, Richard. For me, Newfoundland shows up under the US and not under Canada. I've even tried playing with the order of provinces in a word doc and the only way to remove it from the dropdown is to remove Newfoundland altogether.
Richard_Wasylyn
Level 4
January 17, 2014
Hi Katie,

I submitted a support ticket and it looks like the issue is with the default lists that they have posted. Here is what I got from support:

"I checked the selection options in the form for state/province and found Newfoundland::NL. I think Newfoundland is NF, I changed it, and the Landing Page seems to like it better."

We've got it working now so all you need to do is change the "NL" to "NF" and it should work.

Richard Wasylynchuk
Level 1
January 17, 2014
That did the trick! Thank you!
February 18, 2014
Hi Rajesh,

can you please upload the entire country and state list with all the javascript files here.

As,you used in the below URL :

http://info.digital-pi.net/auto-country-state.html

Because,when i upload the Australia,US and canada ,it is not working.
Please help me out this issue.
Currently,i am using FORM 1.0


June 11, 2014

Hi,

I looked at the example and is that only for forms in 1.0? I am making a new form in 2.0 but when I followed the instructions here https://community.marketo.com/MarketoResource?id=kA650000000GtpdCAC I have only one option in the drop down, which contains all the countries.

Update - I figured it out.

Incase someone else is new to 2.0 you need to change the :: to | 

The values in 2,0 should look like this in Advance Editor

Alberta|AB
British Columbia|BC
Manitoba|MB
New Brunswick|NB
Newfoundland|NL
Northwest
Territories|NT
Nova Scotia|NS
Nunavut|NU
Ontario|ON
Prince Edward
Island|PE
Quebec|QC
Saskatchewan|SK
Yukon Territory|YT

And no need for javascript in 2.0 just enable visibility rules.