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.
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.
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?
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.
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.