How to use dependent form fields

Last updated: December 6, 2017

Available For:

Marketing: Basic, Pro, Enterprise
Sales: N/A

As a marketer, you need an easy way of qualifying potential customers by quickly asking for more information within the same form. With dependent form fields, marketers can easily ask further qualifying questions based on previous answers. For example, if a business only sells to clients in the north east, you can qualify form respondents by country and state.

Here is more specific information about dependent form fields:

  • You can set up dependent form fields on individual questions within a form.

  • You can have one level of depth with your questions, however you can have multiple dependencies. For example, if the visitor selects United States as their country, you could display city, state, and zip code but could not just show state and then based on the answer have another set of options appear. In the same example, if the visitor selected Canada as their country, you could instead display city, province, and postcode at once.

  • Dependent form fields can be used within HubSpot hosted pages as well as embedded (external) pages.

  • No other fields can exist in the same row as a dependent field.

Create or select a form

From your HubSpot Marketing dashboard, navigate to Contacts > Forms and either open an existing form or create a new form.

Edit your dependent fields

Once in your form, hover your mouse over the field you want to add dependencies to and click edit

In the Configuration window on the left, you'll be presented with different settings for your form field. Scroll down to the bottom and click Dependent field to expand this option. In the example below, we're setting up dependent fields for the country field, so it starts with "If Country." 

1. This dropdown has many options: is equal to, is not equal to, contains, doesn't contain, starts with, ends with, is not empty. The options displayed will depend on your form field type.

2. This area is where you'll want to place the value that the visitor will enter into the form. So when you ask what country they're from, this is looking for anyone who says "United States."

3. This dropdown decides which field to show depending on the criteria you've set from the previous steps. So, in this example, if the visitor selects "United States" as their Country, it will then show the State/Region field for them to also fill out.

When you're done, click Add to confirm the new dependent form field. 

You can add another rule if you want to build out more dependencies for this particular field. 

View your dependent form fields

After you set up your dependent form fields, you'll see that the dependent field connected to the field that it is dependent on with a dotted line. In the example below, you can see State/Region tied to Country and that State/Region will only show if Country is equal to United States. You can click Close dependent field options to hide the dependent field(s) while you're viewing and editing your form.

Save your form

Make sure that you click on the Save form button when you are done so that all of your changes are saved.

HubSpot Help article screenshot

Test your form

At the top, click Test to see an interactive preview of the way your form will look on a live page. 

HubSpot Help article screenshot

Was this article helpful?

Previous article:

Next article: