One really cool feature of Marketo forms is that you can dynamically hide/show form fields or fieldsets.
In this example, let’s hide the State field unless Country is selected as “United States.”
Go to Marketing Activities.
Select your form and click Edit Form.
Select the field you want to hide/show dynamically and click the link for Visibility Rules.
Find and select the field you want to build a condition around.
Select the operator.
This is cool because you can choose fuzzy matches like “starts with.”
Select the value(s) to look for, then click outside of the drop-down.
You can select multiple values by clicking them while the drop-down is open. For example, you can select United States and Canada.
We previously converted Country to a pick-list field type and added all countries as values.
And that’s it! Now when people fill out this form and select United States for Country, the State field will dynamically appear with the choices specified.
Form field behavior will work seamlessly when field values are set/updated through custom script using API functions in Forms 2.0.