Skip to main content
Jay_sandbox_Sin
Level 2
Dec 4, 2020 3:11 PM UTC
Solved

Thanks You Page using JS code

A gated landing page show contact us message after filling out the form through JS code.  

Business use case is to generate anchor tag details via the JS code too. is there any workaround for the given Marketo Form JS?

 

<div id="confirmform" style="visibility:hidden;">Thanks!</h3><a href="#">contact-us</a></div>

 

<script> MktoForms2.whenReady(function (form){ form.onSuccess(function(values, followUpUrl){ form.getFormElem().hide(); document.getElementById('confirmform').style.visibility = 'visible'; return false; }); }); </script>

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
SanfordWhiteman
SanfordWhitemanAccepted solution
User Group Leader
Dec 4, 2020 7:44 PM UTC

You can set the href property of any anchor tag using JS.

 

The anchor tag here isn't clearly targetable (it doesn't have an id, unique class, or data attribute) but you could assume it's the only a inside the div#confirmform.

1 reply

SanfordWhiteman
User Group Leader
SanfordWhitemanUser Group LeaderAccepted solution
User Group Leader
Dec 4, 2020 7:44 PM UTC

You can set the href property of any anchor tag using JS.

 

The anchor tag here isn't clearly targetable (it doesn't have an id, unique class, or data attribute) but you could assume it's the only a inside the div#confirmform.

Translate