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.

 

 

Link to comment
Share on other sites

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');">

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.