Is it possible to create a dependent form field? | Community
Skip to main content
November 14, 2013
Question

Is it possible to create a dependent form field?

  • November 14, 2013
  • 4 replies
  • 2898 views
For example, offer country - and then if they select "United States" add a new drop down field for "State"
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

4 replies

November 14, 2013
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?
November 14, 2013
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
June 25, 2015

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
Adobe Employee
Adobe Employee
June 25, 2015

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

November 14, 2013
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

November 14, 2013
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