Jump to content

[SOLVED] Possible to make button open up another page in a window?


Jason28

Recommended Posts

Could anyone please give me a code that allows a submit type button to open up a window for another page?  I tried to use this:

 

<input value="Play All" type="button" href="test.php?genre='.$genre_select.'" onClick="openWin(this.href, \'280\', \'500\', \'yes\')\';" target="_blank" />

 

However it does nothing.  This next code opened up a broken window but opened up the working link in another full window:

 

<input value="Play All" type="button" href="player/test.php?genre='.$genre_select.'" onClick="openWin(this.href, \'280\', \'500\', \'yes\')\';" target="_blank" />

 

I wonder if I can somehow combine the two so that it just opens up the window?  BTW I am aware of the escaped \ before the apostrophes, they have to be there since I am outputting this code using php that has single quotes in the string.  Thanks.

 

 

yes, but I can combine the two and only allow one window to open?  I am not good with javascript.  Thanks!

 

so you want the submit button to submit the form, and then open up a new window?

 

if so could you not put the new winfow into the onload of whatever page the form submits to?

 

eg

 

<body onload="window.open (this.href,'mywindow','location=1,status=1,scrollbars=1,width=280,height=500');">

Nope no form action please.  The button is within another form, so I had to use the location for it the first time to prevent conflicts.  I basically just use the button for cosmetic purposes, not to serve as a submit button.  Thanks!

ok, thats because browser like opening in a new tab, not a new window, i found a way though...

 

 

<input value="Play All" type="button" onclick="window.open(\'test.php?genre='.$genre_select.'\',\'_blank\',\'location=1,width=280,height=500\');" />

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.