I'm having an issue where, when you click 'not you' it refreshes the page .... the form I am using is at the BOTTOM, so it's quite a bit of scrolling to back to where you were. Is there any way to control it, whether it's an anchor, or preventing the page from refreshing and just refreshing the form with a new cookie, or what are my options? Anyone have experience doing this?
Solved! Go to Solution.
Me-oh-my this is unpretty, and I feel dirty even touching jQuery, but it should work:
MktoForms2.whenReady(function(form){
var jQuery = MktoForms2.$,
formEl = form.getFormElem()[0],
notYou = formEl.querySelector('.mktoNotYou');
if (notYou) {
var originalHandler = jQuery._data(notYou).events.click[0].handler;
jQuery(notYou).off("click");
notYou.addEventListener("click",function(e){
document.location.hash = formEl.id;
originalHandler();
});
}
});
would you send a sample or URL?
Thanks Josh,
There's a form at the bottom of this page that we're re-doing; but want to build in the ability to 'not you' to the bottom at the same time.
Me-oh-my this is unpretty, and I feel dirty even touching jQuery, but it should work:
MktoForms2.whenReady(function(form){
var jQuery = MktoForms2.$,
formEl = form.getFormElem()[0],
notYou = formEl.querySelector('.mktoNotYou');
if (notYou) {
var originalHandler = jQuery._data(notYou).events.click[0].handler;
jQuery(notYou).off("click");
notYou.addEventListener("click",function(e){
document.location.hash = formEl.id;
originalHandler();
});
}
});