Forum Moderators: open
(it is echoed in php)
the thing is when a link is clicked on the pop up i want it sent back to the original page and the pop up closed...
can anyone gimme a hand
ATM I don't have the time to code it out, but here is what should work:
1. Remove the window open from the link and call a function. This "base page" is going to be referenced later as it is the "opener" for step 2 and 3.
2. In the function, create a new window and open calendar.php.
3. In the calendar.php file, you need to add some code that references the window.opener and executes a window.close.
VERY rough, but the structure is:
Main file:
<form><input type='button' onClick="myWin('calendar.php');" name='button' value='Book' /></form> ....
...
function myWin (page) {
var win=open (page,id,params);
}
In calendar.php . . .
<a href="goToAndClose('goto.html');">Go to page</a>
.....
function goToAndClose(url) {
if (window.opener &&! window.opener.closed) {
window.opener.location=url;
window.close(); // this should close this window - the pop-up
}
}
Like I said very rough, go forth and debug. :-)
}