Created
October 20, 2017 20:41
-
-
Save cougrimes/20fb7dbccb808cf91f4b18dec98b5764 to your computer and use it in GitHub Desktop.
Show message on same page after successful form submission.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="container"> | |
<script src="//app-abc.marketo.com/js/forms2/js/forms2.min.js"></script> | |
<form id="mktoForm_27"></form> | |
<script>MktoForms2.loadForm("//app-abc.marketo.com", "123-ABC-456", 1);</script> | |
<div id="confirmation" aria-hidden="true" style="display:none;"> | |
<p>This is a sample thank you message. Thanks for viewing.</p> | |
</div> | |
</div> | |
<script> | |
MktoForms2.whenReady(function (form){ | |
form.onSuccess(function(vals, page){ | |
form.getFormElem().hide(); | |
var confirm = document.getElementById('confirmation'); | |
confirm.style.display = 'inline-block'; | |
confirm.setAttribute('aria-hidden', false); | |
return false; | |
}); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment