Click to See Complete Forum and Search --> : popup from FORM <select>


folsombob
01-11-2003, 04:41 AM
Hi, all

I've been able to easily open a new window from links, from radio buttons, and buttons using the window.open, etc.

But I can't get a new window to open from a drop-down menu using the SELECT tag with OPTION,

_and_

control the properties of the new window as I can with window.open and the buttons, etc.

Any solutions? I've search long and experimented hard.

Thanks,

swon
01-11-2003, 04:57 AM
Try something like that:

<script language="JavaScript">
<!--
function winopens(loc,controls)
{
window.open(loc,'yourwindowname',controls); // opens the window;
}
//-->
</script>
<form>
<select name="test" onChange="winopens(this.value,'width=300,height=300,scrollbars=yes,toolbar=yes,location=yes')">
<option>choose
<option value="test.html">test.html
<option value="myother.html">myother.html
</select>
</form>

folsombob
01-12-2003, 02:32 AM
Originally posted by swon
Try something like that:

<script language="JavaScript">
<!--
function winopens(loc,controls)
{
window.open(loc,'yourwindowname',controls); // opens the window;
}
//-->
</script>
<form>
<select name="test" onChange="winopens(this.value,'width=300,height=300,scrollbars=yes,toolbar=yes,location=yes')">
<option>choose
<option value="test.html">test.html
<option value="myother.html">myother.html
</select>
</form>

Thanks, swon

I downloaded your suggestion last night and incorporated it successfully today.

Rather simple when I examined it, but couldn't have done it without your suggestion. Much appreciated!