How to use dependent form fields

Last updated: June 15, 2016

Available For:

Product: HubSpot Marketing
Subscription: Basic, Professional, & Enterprise

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 setup 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 Dashboard, navigate to Contacts > Forms and either open an existing form or create a new form.

HubSpot Help article screenshot

Edit your dependent fields

Once in your form, navigate to the field you want to add dependencies to by clicking the double arrow icon. 

From the pop-up window, you'll be presented with a few steps for setting up your dependent fields. You'll first see the name of the field before your options. In the example below, we're setting up dependent fields within 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. This is how you'll set the condition for how your dependent field will show up.

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.

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

When you're done, make sure you save your changes.

View your dependent form fields

After you set up your dependent form fields, you'll see that the dependent field is nested within the field that it is dependent on. In the example below, you can see State/Region nested within Country and that State/Region will only show if Country is equal to United States.

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

Preview your form

At the top, click preview to get a glimpse of the way your form will look on a live page.

HubSpot Help article screenshot

Previous article:

Next article: