PDA

View Full Version : How to Size a Window with target="newwin"



beachbound
12-06-2006, 05:55 PM
I have a drop down List menu, and when you select an item in the list, It pops up a New Browser as its supposed to using the target="newwin" function. But I also need to size the Popup Browser and cant seem to make it happen.

Any help would be greatly appreciated..

Here is what I have so far.

<form name="form1">
<select name="select1" size="1" style="background-color:#FFFFD7">
<option selected>Select your print Item</option>
<option value="product_display.php?category_id=5" target="newwin" >Business Cards</option>
<option value="product_display.php?category_id=5" target="newwin" >Tent Cards</option>
<option value="product_display.php?category_id=2" target="newwin" >Postcards</option>
<option value="product_display.php?category_id=8" target="newwin" >Letterhead</option>
AND SO ON..

jscheuer1
12-07-2006, 05:28 AM
That code will not do what you say. At least not by itself. It looks familiar to me though. Is it this script:

http://www.dynamicdrive.com/dynamicindex1/combodescribe.htm

??

If so, you would need to edit this function:


function jumptolink(what){
var selectedopt=what.options[what.selectedIndex]
if (document.getElementById && selectedopt.getAttribute("target")=="newwin")
window.open(selectedopt.value)
else
window.location=selectedopt.value
}

You would add the specifications desired to that line, ex:


window.open(selectedopt.value,'','scrollbars,location,directories,status,menubar,toolbar,resizable,width=300,height=300');

beachbound
12-08-2006, 05:41 PM
Hey John,

Thanks for the Reply, You are correct about the script that I am using, unfortunately its still not working. Now it wont popup a new browser window at all.

This is what I have changed the lower script to:

function jumptolink(what){
var selectedopt=what.options[what.selectedIndex]
if (document.getElementById && selectedopt.getAttribute("target")=="newwin")
window.open(selectedopt.value,",'scrollbars=no,width=630,height=550');
else
window.location=selectedopt.value
}

jscheuer1
12-08-2006, 06:25 PM
Not a single double quote("):


window.open(selectedopt.value,",'scrollbars=no,width=630,height=550');

Use empty single quotes (') as in my example:


window.open(selectedopt.value,'','scrollbars=no,width=630,height=550');

It might help to understand that this is where the name of the window would go, if one were desired, ex:


window.open(selectedopt.value,'my_win','scrollbars=no,width=630,height=550');

beachbound
12-08-2006, 07:45 PM
Perfect!!!!!!!!

Thank you for the Help.


Dave