Is it possible to create a dependent form field?

Anonymous
Not applicable

Is it possible to create a dependent form field?

For example, offer country - and then if they select "United States" add a new drop down field for "State"
Tags (1)
6 REPLIES 6
Anonymous
Not applicable

Re: Is it possible to create a dependent form field?

Daisy,

I believe there is code for this on the community (or at least along the same lines). However, Marketo is currently working on Forms 2.0 which will allow fthis kind of dependency. I think this is supposed to be released early next year?
Anonymous
Not applicable

Re: Is it possible to create a dependent form field?

Yes, with the help of JavaScript. Here are the steps, just note where it outlines Marketo support us not in a position to troubleshoot custom javascript http://community.marketo.com/MarketoResource?id=kA650000000GtpdCAC
Anonymous
Not applicable

Re: Is it possible to create a dependent form field?

Hi Cathal, Thanks for taking time to provide the solution. Can you please share the java script again. the link above is old, and is not working.

Thanks

Deepak

Steven_Vanderb3
Marketo Employee

Re: Is it possible to create a dependent form field?

Hi Deepak,

This discussion is from 2013 and the Javascript solution is no long neccessary.  Please see the following documentation on Forms 2.0 and visibility rules to set this up.  Dynamically Toggle Visibility of a Form Field - Marketo Docs - Product Docs

Anonymous
Not applicable

Re: Is it possible to create a dependent form field?

Hi Cathal, 

I am trying to do the same thing as Daisy. When I include the javascript from the article you suggested it hides the state field for all countries including US and Canada. My company uses three letter country codes instead of two as referenced in the article. Could this be what is causing the issue? 

Thanks

Anonymous
Not applicable

Re: Is it possible to create a dependent form field?

Hi Carey, possibly yes. I'm not a JavaScript expert but assume that the public file that stores the script is set for the basic country names and not the country codes. I don't think it would take much to adapt the code, just substituting the country names with the country codes but This is why we make the note at the top of this resource that it's best to have a JavaScript expert on hand. Rgs, Cathal