I have an HTML page with a simple form.
When the user clicks “submit”, I’d like a new window to open with the processed results of the form, AND to have the original page redirect somewhere else.
If I use a link with target=”_blank”, I can open the results window but not redirect the original page.
If I use Javascript to try and open the new window and then redirect the current page, the opening of the new window gets blocked (at least by my Firefox’s default popup blocker).
Is there any way to get both a new window and run some Javascript in the original page?
Thanks!
Firstly, you’ll need to set the “target” of the form you’re submitting to “_blank”, then use the onsubmit event of the form to change the current location as follows: