SOLVED

URL Parameters Working in Conjunction with Dynamic State

Go to solution
Anonymous
Not applicable

URL Parameters Working in Conjunction with Dynamic State

I am trying to have a URL Parameter fill in the country of a form, but I want the field to show in case they need to change it. Also, if the country is filled in with US, CA, or AU, I want the dynamic state functionality to work.

Has anyone tried this? I imagine custom code will be required, but I thought I would ask the Community first.

Thanks!
Tags (1)
1 ACCEPTED SOLUTION

Accepted Solutions
Anonymous
Not applicable

Re: URL Parameters Working in Conjunction with Dynamic State

From what I understand, you would need custom javascript code to get this functionality. 
Also, you may want to present the Country field as a single select field with list of countries. And when the country value is changed, you want to show another single select field with states for that country.

In your javascript code, 
1> Check if country is already populated by Marketo. If yes, do not override (depends on your requirement)
2> Otherwise, read the query parameter and populate the country. And also show the rest of the country value options.
3> Separately, you can have 3 javascript arrays each for states of US, CA and AU. On change of the country value, if it is among these 3 countries, show the state field and populate the choices for the respective array.

Let me see if I can find the javascript code...

Rajesh

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Re: URL Parameters Working in Conjunction with Dynamic State

From what I understand, you would need custom javascript code to get this functionality. 
Also, you may want to present the Country field as a single select field with list of countries. And when the country value is changed, you want to show another single select field with states for that country.

In your javascript code, 
1> Check if country is already populated by Marketo. If yes, do not override (depends on your requirement)
2> Otherwise, read the query parameter and populate the country. And also show the rest of the country value options.
3> Separately, you can have 3 javascript arrays each for states of US, CA and AU. On change of the country value, if it is among these 3 countries, show the state field and populate the choices for the respective array.

Let me see if I can find the javascript code...

Rajesh

Anonymous
Not applicable

Re: URL Parameters Working in Conjunction with Dynamic State

Thanks Rajesh!