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>
Solved! Go to Solution.
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.