Most pages on my site I won't want forms. There are some more valuable pieces of content I want to put behind forms, but I don't want to make people submit 20 forms to read my 20 best articles.
I don't really like the if known show custom HTML functionality in forms 2.0 either. Is there a way to hide the form and custom HTML if I get a known visitor? Munchkin already tracks page visits for known visitors, so I'd like to hide the form.
Anybody else feel this pain and solve it?
Solved! Go to Solution.
Hi Eric
If you change HTML to <div></div> at custom HTML editor,show nothing.
Hi Eric,
Takehiro's answer is definitely the simplest. Alternatively, you could use example #1 at our developer documentation:
Forms 2.0 » Marketo Developers
and add this in an HTML block on the page:
<script>
MktoForms2.whenReady(function (form) {
// Add an onSuccess handler
form.onSuccess(function(values, followUpUrl) {
// Get the form's jQuery element and hide it
form.getFormElem().hide();
// Return false to prevent the submission handler from taking the lead to the follow up url
return false;
});
});
</script>
This example only applies upon successful submission. There's a few ways to do it with the API, but Takehiro's is the most elegant one.