Popup open/close, form submittal, and redirection in one
This is what I'm trying to do:
1) User clicks a link that opens a popup window
2) They click a check box under an agreement form and click "I agree"
3) Which then closes the popup window and redirects them to a url offsite
The problem with this I found out, is that the page I redirect them to, is another website, that when the user clicks a link "return to ______ website", they end up getting redirected back to the url of the html page (agreement text) loaded in the popup window, not the website! Not good.
So the solution I'm thinking, would be to do everything in one html code??? Or will that not work? Any other solutions/ideas?
And to help anyone else out, here's the code I did what I did with:
The initial page code:
function popup(mylink, windowname)
if (! window.focus)return true;
if (typeof(mylink) == 'string')
window.open(href, windowname, 'width=500,height=500,scrollbars=no');
<a href="popup1.html" onclick="return popup(this, 'notes')">LINK OR BUTTO TO CLICK GOES HERE</a>
Then what I put in the popup html file (popup1.html):
function targetopener(mylink, closeme, closeonly)
if (! (window.focus && window.opener))return true;
if (! closeonly)window.opener.location.href=mylink.href;
This is where I put the entire description of the user agreement. You can add a div and make scrollable boxes here as well if you want to keep it nice and tidy. Mine was short enough there was no need."<br><br>