PDA

View Full Version : Pop up windows - how to make them pop up more than once?


Sophie Stuart
03-12-2003, 09:47 AM
Good morning every one!
I use this code to create a link to a page that opens in a new window (popup window):
<a href="samband.php" target="newuser" onClick="window.open' samband.php', 'newuser', 'toolbar=no, location=no, status=no, top=100,left=100, menubar=no, scrollbars=no, resizable=no, width=400, height=350'); return false;">

My problem is that if you have once opened this popup window and then returnsagain to the main page, without closing it, it does not pop up the next time you click on the link. Is there some way to change that?

Thanks,
Zoe.

RadarBob
03-12-2003, 02:36 PM
Here's a little function that I wrote, you can use it note for note, so don't worry be happy.


function closePopups() {
var allPopupsClosed = new Boolean(true);

if (typeof DBKeywordsWindow != "undefined" && !DBKeywordsWindow.closed) {
DBKeywordsWindow.focus();
allPopupsClosed = false;
}
return allPopupsClosed;
} // checkPopups()


I use the above function to make sure the child window gets closed when the
user attempts to submit form input. Here's the code that calls the
function:

// my html page:
<form name="myForm" onsubmit="postProcess(this);">

. . .

function postProcess (theform) {
var validForm = new Boolean (true);

validForm = closePopups();

. . . // do more form validation

return validForm
}
/*
validForm gets returned to SUBMIT so the effect is the user form
does not get submitted and the child window is sitting in focus.

*/

Sophie Stuart
03-13-2003, 02:22 PM
Thanks alot. I was also told that you could write target_blank, but then of course you can end up with many open windows.
I'll try it our.
Zoe.