Click to See Complete Forum and Search --> : Loading a window into a separate window.


tripwater
04-16-2003, 01:42 PM
I have a link on my site that opens a popup that walks a user step by step through an account setup. I have that under control. I know how to adjust the window and all that jazz.

My deal now is on one of the pages as the user is going along they have a link that (they are still in the popup) when clicked opens a small descriptive window to help them out.

My problem is when they click this link it opens this descriptive window into my original popup window instead of a separate window. How do I accomplish this? Thank you ahead of time for your time. My code below :

******************************************************
<javascript>

var picwindow;

function openwin(url)
{
picwindow = window.open(url,"SpamnIt",
"height=500,width=625,toolbar=yes,resizable=yes,scrollbars=yes,left=0,top=100,screenX=0,screenY=100");

picwindow.focus();

return false;

}

</script>




<a href="" onclick = "return openwin('../main/ispcheck.php');">
<IMG SRC="../images/protect.gif" WIDTH=127 HEIGHT=25 BORDER=0 ALT="Protect Yourself"></A>

This opens my original popup now I assumed I needed same function just different name so I used this within the popup to open the other window:



<javascript>

var picawindow;

function openit(url)
{
picawindow = window.open(url,\"SpamnIt\",
\"height=225,width=450,toolbar=no,scrollbars=yes,resizable=yes,left=500,top=400,screenX=0,screenY=100\");

picawindow.focus();

return false;

}

</script>



<td colspan=4>
If you would like to pay by check/money order, please check the button below.
(<A HREF=\"\" onclick = \"return openit('../main/checkexp.php');\"> Important Note </a>) <p>
</td>



thanks again for any help in what I am doing wrong.

DrDaMour
04-16-2003, 01:47 PM
the second paramter in window.open is the target, since all your new window commands call the same fucntion that use the same target name, they'll only open in the window, what you should od is change teh parameters to include two parameters:

function mw(url,tar){
window.open(url,tar,.......
}

tripwater
04-16-2003, 01:55 PM
I appreciate your time. I thought that the second param named the window for example where I had SpamnIt I thought it would say that at the top of the window when it opened. Learned something new....I am gradually chiseling away at this javascript. thank you again.