How do I add a hidden field to my form?

A hidden field can be used to pass information about contacts into your account when they submit your form. This field is not visible to your contacts. You can use a hidden field to collect information, such as UTM parameters, or even use it to help identify spam bot submissions.

Take note

  • Hidden fields are text-only fields
  • Hidden fields can only be used with Inline forms. Hidden fields cannot be added to floating box, floating bar, or modal forms

Create a hidden field

To add a hidden field to your form:

1. Click "Site" on the left menu of your account.

2. Click the "Forms" option on the Site menu.

3. Locate the form you wish to work with, then click the "Edit" button.

4. The form builder will load. All editing and style options will appear in the right pane. Click the "Fields" option on the right pane then click "My Fields."

5. Click the "Add a custom field" button

6. An "Add Field" modal window will open:

  • Type the name of the field into the "Field name" field
  • Click the "Group" dropdown then click the group that this field should belong to
  • Click the "Field Type" dropdown and click the hidden field option
  • Click the "Add" button 

7. The field will be added to the Fields > My Fields section of the right pane. You may need to scroll down through the list of fields to see it. Once you locate the hidden field you just created, drag it to your form in the form builder.

Use hidden fields to collect information about your contacts

Now that you have added a hidden field to your form, you may be wondering how exactly that field will collect information about your contacts. There are a few different ways to go about this:

1. Add a query string to your form's URL

Adding a query string to your form's URL will add a fixed value to your hidden field.

For example, let's say I have a hidden field called “Hidden Field” in my form and the personalization tag for that field is %HIDDEN_FIELD%.

When a contact submits my form, I want that hidden field to display the value of “Test” on that contact's profile page.

To do that, I would need to fetch the personalization tag for that field (go to Forms > Manage fields) and remove the percent (%) signs.

Then I would grab my form's URL: https://atestaccount.activehosted.com/f/15 and append it with this: ?hidden_field=Test so that the form URL now looks like this: https://acdemosarah.activehosted.com/f/15?hidden_field=Test

This is how the form looks in an account. Note the hidden field:

This is how the form will look from the contact's point of view. Note the appended form URL:

When a contact submits my form, this is what I will see in their contact profile page. Note that the value for my hidden field is "Test":

To pass UTM parameters into a hidden field, create a hidden field then modify its associated personalization tag to use an underscore. This will make it match the URL parameter.

2. Add a fixed value to your full embed code

After adding your hidden field to your form, copy and paste the full embed code for the form to your site. Then, insert your fixed value for that hidden field into your form's HTML code.

Here is an example showing you where to add that fixed value:

3. Add a dynamic value to your full embed code

You can add custom code to your site to dynamically “post” information to your hidden field when a form is submitted. This option will require custom coding on your end.

Use hidden fields to help identify spam submissions

To use a hidden field to help identify spam submissions, all you need to do is add a hidden field to your form and leave it blank. You may want to label this hidden field “Spam” or “Spam Contact” so you can easily identify it later. Then, if your form is submitted with a value for that field, you'll know that a spam bot submitted your form and not an actual person.

It is important to note that this is not entirely foolproof as smart bots will not fill out a hidden field. The best way to protect your form from Spam submissions is to add a CAPTCHA to your form and to enable a double opt-in

Have more questions? Submit a request