Hidden fields - Is Pre-Fill enabled?

Anonymous
Not applicable

Hidden fields - Is Pre-Fill enabled?

Hi All, 
I need to pass the Record ID through one of my forms. First I enabled Pre-Fill so the lead's ID information will automatically be filled in. However, once I made the field a hidden field, it says "Hidden: 'null'"

Does this mean that, even though pre-fill is supposedly enabled, that the default value will be blank?


 
Tags (1)
5 REPLIES 5
Justin_Cooperm2
Level 10

Re: Hidden fields - Is Pre-Fill enabled?

When you choose that a field is "hidden" you then need to select how it is filled. In the forms editor, you will see an "autofill" option. Select that and determine if you want to fill that field with the same value every time the form is submitted (Default Value), or with a URL parameter, Cookie value, or Referrer parameter. 

The concept you described doesn't make a lot of sense. If a field is hidden, the prospect can't see it. If you want to pre-fill that field with an existing value in the database, what is the point of that? Just don't even include that field, that value will still be in your database.
Anonymous
Not applicable

Re: Hidden fields - Is Pre-Fill enabled?

Hi Justin,
I need to pre-fill it with an existing value so I can pass the Record ID field value into another system via a webhook. Long story short, we have an error that is occuring with the webhook, and the only way for us to eliminate it is to pass the value through separately as a form field, but I also don't want the user to see it.

I did see the auto-fill options, but none of them achieve what I need...unless I can use a token as the "default value". Does anyone know if that will work?

I believe the option to "always hide" a pre-filled enabled field used to be available through the visibility rules, but it doesn't seem to work anymore.
 
Anonymous
Not applicable

Re: Hidden fields - Is Pre-Fill enabled?

Also, why would there be an option to enable or disable the pre-fill option for hidden fields if pre-filling doesn't work for hidden fields?
Anonymous
Not applicable

Re: Hidden fields - Is Pre-Fill enabled?

I'm trying to do the same thing with an email preference center. I'd like to use a hidden field to drive visibility rules on a form.

I just decided that I need to determine a way to elegantly include the field (unhidden) into the form. Wish there was a better way.

SanfordWhiteman
Level 10 - Community Moderator

Re: Hidden fields - Is Pre-Fill enabled?

You just need to reverse your approach, as I mentioned on another thread on the same topic.

Do use Marketo's built-in hidden field functionality to read from query params or cookies.  It's not worth reimplementing that part.

But then use those hidden fields as data sources for additional logic.

In this demo the hidden `Last Name` field is taken from the query param `LN`, if present.

Then the hidden field is unhidden and inserted into the form.

The regular field `Middle Name` has a Visibility Rule applied so it will only be shown if the hidden `Last Name` was not empty.

The Forms 2.0 API (JavaScript) ties together the standard form field types/configs to create special UI behavior.