SOLVED

Thanks You Page using JS code

Go to solution
Jay_sandbox_Sin
Level 2

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>

 

1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Thanks You Page using JS code

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.

View solution in original post

1 REPLY 1
SanfordWhiteman
Level 10 - Community Moderator

Re: Thanks You Page using JS code

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.