SOLVED

If Known Visitor, Hide Form

Go to solution
Highlighted
Anonymous
Not applicable

Re: If Known Visitor, Hide Form

Sanford, you wizard. It works amazingly.

Thank you for your help. For modal forms, this should be the top rated comment.

Highlighted
Level 10 - Community Moderator

Re: If Known Visitor, Hide Form

Great, glad it worked!

Highlighted
Level 2

Re: If Known Visitor, Hide Form

Hi Sanford, I'm trying to implement this but when I add <script>document.body.className += ' mktoKnownLead';</script> into the Custom HTML for Known Leads HTML Source Editor, it gets translated and saved as:

<script>// <![CDATA[

document.body.className += ' mktoKnownLead';

// ]]></script>

Any ideas?

Highlighted
Level 10 - Community Moderator

Re: If Known Visitor, Hide Form

Does it still execute, though? That's the question.

Highlighted
Level 2

Re: If Known Visitor, Hide Form

My apologies, it does work! I was looking at the wrong place. Thanks for this!

Highlighted
Level 7

Re: If Known Visitor, Hide Form

Rereading the original thread, I see I was thinking of a very different situation. Thanks Kenny!

Highlighted
Anonymous
Not applicable

Re: If Known Visitor, Hide Form

Hi Eric,

I'm trying to understand your use case to see if it is similar to mine. Pretty much, if I have a known visitor, I want them to be able to get to the gated content, without the gate. What did this custom HTML do for you?

Highlighted
Level 10 - Community Moderator

Re: If Known Visitor, Hide Form

The custom HTML (and CSS) ensures that that the act of showing the Known Lead HTML in turn hides the entire form.

Highlighted
Level 7 - Champion

Re: If Known Visitor, Hide Form

Hi everyone!

Further to this I'm using pop up forms on a  guided template, and I want to do a  similar thing with those forms, so when it's a know visitor the form doesn't show, it just goes directly to the asset.

Can anyone help?  I tried using this code:

<script>

  document.body.className += ' knownLead';

</script>

Then add Custom CSS to the form:

.knownLead .mktoModal {

  display: none;

}

But it doesn't work.

My test landing page is here:

http://go.cornerstoneondemand.com/Julz-Test.html

Thanks

Juli

Highlighted
Level 10 - Community Moderator

Re: If Known Visitor, Hide Form

In your case the modal uses a different DOM structure (created by the bPopup plugin).

This CSS will hide the form and modal wrapper (together with the Known Lead HTML above, of course).

.knownLead .b-modal.__b-popup1__, .knownLead .mktoForm {

    display: none !important;

}

But I think your goal is slightly different because you don't want to only hide the form, you want to let the person download immediately.  Which means your Known Lead HTML <script> block should probably end with

document.location.href="http://go.cornerstoneondemand.com/your.pdf";