Hi Cristal,
Could you be more specific about how it is not working? I do think I see what is wrong, but please confirm.
It is important to note that setting the form element's HTML to '<a href="http://info.impactlearning.com/Newsletter-Thank-you.html"></a>' as you have will result in a totally blank page, as there is no content between the opening <a> and the closing </a>. Usually you would wrap text in an anchor tag to make it link to a page; in this case, you would need to paste the entire HTML source of the page into that area if you wanted to display the page as it exists at that URL. You can also fetch the HTML content of a page using a jQuery $.get request, store it in a variable, and put the variable name as the parameter to the .html() function instead of a string.
I can work out an example of that and post it here soon, but to make sure you are using the correct button ID, can you test if the code I pasted below shows a (very basic) success message?
Hope it works!
<script src="//app-abb.marketo.com/js/forms2/js/forms2.js"></script>
<form id="mktoForm_85"></form>
<script>MktoForms2.loadForm("//app-abb.marketo.com", "275-XMK-766", 85,
function(form) {
form.getFormElem().hide();
});
var button = document.getElementById("ext4-ext-gen1362");
button.onclick = function (){
// add whenReady handler, which fires for every form on the page
MktoForms2.whenReady(function (form){
// create lightbox and store it in variable
var lightbox = MktoForms2.lightbox(form);
// show lightbox
lightbox.show();
// show the form itself
form.getFormElem().show();
// Add onSuccess handler
form.onSuccess(function(form){
// fetch form's jQuery element
var formElement = MktoForms2.getForm(form.formid).getFormElem();
// set HTML of element using jQuery
formElement.html('<h1>Success! Thanks, ' + form.FirstName + '.</h1>');
// return false to prevent the submission handler from taking the lead to the follow up url.
return false;
});
});
};
</script>