Hello Here s my question of the day, I am opening a contact form using modal box of mootools. That works fine, now, when the user clicks "send", i can get it to close the box <input value="send" type="submit" onclick="window.parent.document.getElementById('sbox-window').close(); "/> PHP: Now the problem is, how can i , on click, close the box and redirect the parent page to a "tks for your email page ". I ve tried many things but it always do the redirection in the lightbox and it does not close the window anymore Any help is very welcome
hello where would you insert it in the code of the first post, so that it closes the lightbox and forward the user to amazon?
You have a popup ( or simply a new window, opened by another window ) and you close it by pressing Close button, right ? Now, instead of using your current onClick event, create a JS function, containing your current onClick + the one I pasted earlier ( Close event should be AFTER redirect ). <script type="text/javascript"> function CloseRedirect() { window.opener.location.href = 'http://www.amazon.com'; // Redirect window.parent.document.getElementById('sbox-window').close(); // Close } </script> <input value="send" type="submit" onclick="CloseRedirect()"/> PHP:
Just tried, i ve tested only the close function in the js, it works, then i ve tried with the full thing, it does not work, it does not redirect and it does not close the lightbox :-/
finally got the right answer from chronoengine forum onclick="window.parent.document.location = 'new url here'" PHP: it works tks