Country and state/province fields on Forms

Richard_Wasylyn
Level 4 - Champion Alumni
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?
Richard Wasylynchuk
Tags (1)
14 REPLIES 14
Anonymous
Not applicable
I followed the instructions at https://community.marketo.com/MarketoResource?id=kA650000000GtpdCAC 

I want the country names spelled out so I tried to follow this part: 

Full country and state names


Where in Marketo do I upload the file "fullStateCountry.js"?


Thanks,

David

Anonymous
Not applicable
Amazing. I missed the button the first 87 times. Thank you!!
Anonymous
Not applicable
Yes, you can have state be required and conditional with forms 2.0. Just make sure to enable the visibility rules as well as make the field required when you select the field in the editor.
Anonymous
Not applicable
Is there a way to make state/province mandatory on Forms 2.0? We use conditional state/province lists for three countries: US, CA, DE.


Anonymous
Not applicable

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. 
Anonymous
Not applicable
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


Katie_McKay
Level 1
That did the trick! Thank you!
Richard_Wasylyn
Level 4 - Champion Alumni
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
Katie_McKay
Level 1
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.
Anonymous
Not applicable
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!
Richard_Wasylyn
Level 4 - Champion Alumni
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
Richard_Wasylyn
Level 4 - Champion Alumni
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
Anonymous
Not applicable
Hi Richard,

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


Anonymous
Not applicable
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