Hi,
I’m trying to send the user to my actual website automatically after receiving the success message from completing a form submission.
When the form is complete the lightbox pops up, but I can’t manage to redirect them after they close the lightbox.
I’ve tried this:
var closelightbox = document.getElementById('element-id');
closelightbox.onclick = redirectPage;
function redirectPage() {
window.top.location.href = "https://www.example.com";
return false;
}
For element-id, I have used:
ubpoverlay-overlay
ubpoverlay-close
It works on elements within the lightbox but not anything outside of the lightbox. Essentially I want to click anywhere on the page and be redirected.
And just body wide:
$(document.body).click(function() {
window.top.location.href = "https://www.example.com";
});
Any ideas?
Thanks