Thanks You Page using JS code | Community
Skip to main content
Jay_sandbox_Sin
New Participant
December 4, 2020
Solved

Thanks You Page using JS code

  • December 4, 2020
  • 1 reply
  • 1634 views

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.
Best answer by SanfordWhiteman

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
SanfordWhitemanAccepted solution
New Participant
December 4, 2020

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.