Re: Conditional form field based on known/unknown visitor?

Anonymous
Not applicable

Conditional form field based on known/unknown visitor?

Hello - is it possible to only display certain fields on a form if the visitor is already known to us? Or vice versa, only display a field if they are not known?

If this is possible, how can it be done? Would this only work on Marketo landing pages? Or could it work for Marketo forms embedded in our website too?

Tags (2)
1 REPLY 1
SanfordWhiteman
Level 10 - Community Moderator

Re: Conditional form field based on known/unknown visitor?

Hello - is it possible to only display certain fields on a form if the visitor is already known to us? Or vice versa, only display a field if they are not known?

It is possible by using JS to pre-check the known visitor endpoint, but let me suggest a different method that simply reuses the built-in Known Visitor HTML ("If Known Visitor, show Custom HTML") feature.

Set up 2 forms, Form A for anonymous sessions (= unknown visitors) and Form K for associated sessions (= known visitors).

Include the scaffolding for both forms (<form id="mktoForm_nnn">) in the page.

Enable KV HTML on Form A. In the Custom HTML Editor, have a <script> that loads Form K.

This way, when KV HTML is triggered, it loads the other form instead.