pop up window help

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
doubt
Forum Newbie
Posts: 8
Joined: Tue May 25, 2004 12:44 pm

pop up window help

Post 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 :P thanks
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

lose the href or the onclick.
doubt
Forum Newbie
Posts: 8
Joined: Tue May 25, 2004 12:44 pm

Post by doubt »

if i lose the href that means i'll lose the hyperlink text ? so how to click on that link ?
doubt
Forum Newbie
Posts: 8
Joined: Tue May 25, 2004 12:44 pm

Post by doubt »

can anyone give me some sample code on calling pop up window?
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Re: pop up window help

Post 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 :P 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...
doubt
Forum Newbie
Posts: 8
Joined: Tue May 25, 2004 12:44 pm

Post by doubt »

oh thanks ...i think i solve the problem...
Post Reply