No worries Greg you've been very helpful! Thank you!
I'll hook you up later tonight.
There are a couple of basically equivalent approaches, but here's an easy one: http://pages.vaneckdemos.com/Form-Disclaimer-from-Token.html
The LP contains this bit of code (in an HTML block):
<script>
MktoForms2.whenReady(function(form){
var formEl = form.getFormElem()[0],
replaceableEls = formEl.querySelectorAll('[data-replace-with]');
Array.prototype.forEach.call(replaceableEls, function(el) {
replacementEl = document.querySelector('#'+el.getAttribute('data-replace-with'));
el.parentNode.replaceChild( replacementEl, el );
replacementEl.removeAttribute('style');
});
});
</script>
This is the disclaimer on the LP with the token:
And this is the Rich Text area on the form:
Note the code allows you to have unlimited pairs of data-replace-with and replacement elements.
Nice work, thank you!
This is awesome thanks Sanford Whiteman Grégoire Michel
For the js element in html block I couldn't, create a html block since I'm using a guided template (not free-form)
so I inserted it in the template, should I put it along with the other scripts?
I tried inserting in the header, it doesn't seem to work.
Hi Will,
Insert it in the footer. The form has to be created for the additional code to work.
-Greg
Thanks Greg, should I include this in the footer too:
<div ID="Disclaimer" style="display:none">{{my.Disclaimer}}</div>
Will, I advise putting the disclaimer above the form.
Greg, the script needs to run after the Marketo forms library (forms2.min.js) is included, but it it doesn't have to be after the form itself. (An inline <script> that calls MktoForms.whenReady will be done before the form is injected into the page.)
Got it. Thx
Awesome, thanks so much works like a charm!