Details
While it's not possible to have hidden form fields in the traditional sense, you can pass values to list fields via URL parameters - which is similar and still achieves the same end result.
All you need is the URL of your form & the field name(s) you wish to write data into via the URL. Combine the two together and you've got yourself a form that can have additional data written into it, by way of the form URL.
What This Example Will Cover
In our example below, we'll be hard-coding an NPS Score & Campaign value into the URL of the form. That way, we can have some nice 0 - 10 buttons in the email we send out - each with a different value coded into in the URL for the respective link (as shown below).
How-to Guide
- We'll begin by locating the URL to our form. To do so, select Lists and Forms from the sidebar.
- Double-click on the list in question, to navigate to the forms for that list. The various forms attached to your selected list will now appear as tabs.
- Select your desired form.
- To the top right, click the Add form to website link.
- Locate the form's long URL and copy this down somewhere then close this popup dialog. For the purposes of this example, let's say that our form URL is: https://example.com/em/forms/subscribe.php?db=528938&s=185717&a=12345&k=3fZCeL98PgCIq_SoiGwSFk4ZgctPbsKV5bNU5gAVlao
- Next up, we'll locate the form field(s) we wish to pass via URL parameter. Have a look at the Fields panel over to the right hand side of your form and note down the names of the field(s) you wish to use. In the case of our example, we wish to set the NPS Score value via the URL, so we'll note down the name of the NPS Score field. We also have a Campaign field we wish to hard-code via URL, so we'll note this down too.
- Now we'll add our field(s) onto the end of our form URL, using an & (ampersand) as the separator and an = (equals sign) to set the value. So following on with our example, our URL would look like this: https://example.com/em/forms/subscribe.php?db=528938&s=185717&a=12345&k=3fZCeL98PgCIq_SoiGwSFk4ZgctPbsKV5bNU5gAVlao&NPS_Score=9&Campaign=December2020EDM
If your field has a space in it, you'll need to replace it with an underscore. So in our case, 'NPS Score' becomes 'NPS_Score'.
- You can now insert this URL into an email by linking to it, or sending the URL around through other methods - such as on chat, on Facebook, etc - as required.
Advanced Options
You can also add wildcards into your form URL (if it's being sent / linked-to from within an email). Let's say you want the person's first name to appear in the URL (and thus, be saved into a hidden field called, for example, 'Submitted by'). You can do this by adding a wildcard for this field into the URL.
As an example, let's say our first name field is called 'First Name', so the wildcard for it would be: %%First_Name%%. As such, the URL would appear as:
https://example.com/em/forms/subscribe.php?db=528938&s=185717&a=12345&k=3fZCeL98PgCIq_SoiGwSFk4ZgctPbsKV5bNU5gAVlao&NPS_Score=9&Campaign=December2020EDM&Submitted_by=%%First_Name%%
So if someone called Tiffany received your email and clicked the link, the URL for Tiffany would appear in her browser as:
https://example.com/em/forms/subscribe.php?db=528938&s=185717&a=12345&k=3fZCeL98PgCIq_SoiGwSFk4ZgctPbsKV5bNU5gAVlao&NPS_Score=9&Campaign=December2020EDM&Submitted_by=Tiffany
This will only work if the link is within an email. If you provide the direct link to someone, the system will not know what value to populate the 'Submitted By' field with.
Further Reading
You can also submit hidden form data when you embed a form on your website.