Page 1 of 1
pop up window help
Posted: Tue May 25, 2004 12:44 pm
by doubt
echo " <A target=\"_blank\" onClick=\"window.open('addtocart.php?customerid=".$customerid."&productid=".$row["productid"]."','mywindow','width=400,height=300,left=0,top=100,screenX=0,screenY=100')\" href=\"addtocart.php?customerid=".$customerid."&productid=".$row["productid"]."\">Add to cart</a><br>";
i try this statement with click on addcart but 2 new window come with..
can any1 correct my statement ? or post the statement i should code..
cos i dont knw how to call pop up window

thanks
Posted: Tue May 25, 2004 12:49 pm
by feyd
lose the href or the onclick.
Posted: Tue May 25, 2004 12:55 pm
by doubt
if i lose the href that means i'll lose the hyperlink text ? so how to click on that link ?
Posted: Tue May 25, 2004 1:02 pm
by doubt
can anyone give me some sample code on calling pop up window?
Re: pop up window help
Posted: Tue May 25, 2004 1:10 pm
by Weirdan
doubt wrote:
Code: Select all
echo " <A target="_blank" onClick="window.open('addtocart.php?customerid=".$customerid."&productid=".$row["productid"]."','mywindow','width=400,height=300,left=0,top=100,screenX=0,screenY=100')" href="addtocart.php?customerid=".$customerid."&productid=".$row["productid"]."">Add to cart</a><br>";
i try this statement with click on addcart but 2 new window come with..
can any1 correct my statement ? or post the statement i should code..
cos i dont knw how to call pop up window

thanks
Code: Select all
echo " <A target="_blank" onClick="window.open('addtocart.php?customerid=".$customerid."&productid=".$row["productid"]."','mywindow','width=400,height=300,left=0,top=100,screenX=0,screenY=100'); return false;" href="addtocart.php?customerid=".$customerid."&productid=".$row["productid"]."">Add to cart</a><br>";
return false should do the trick, but some strict browsers may ignore it...
Posted: Tue May 25, 2004 1:15 pm
by doubt
oh thanks ...i think i solve the problem...