...

View Full Version : figuring out links with forms



pcp71
04-28-2003, 06:04 AM
I'm trying to set up a group of similar links into "form" style
with a pull down menu using the OPTION method

the thing is though I want the new web page to open in a NEW window not the "_top"

can someone give me any source code that might help ??

thanks,
Phil

cg9com
04-28-2003, 07:28 AM
Hi,
You can create a sort of 'group' inside of an <select> form element using <optgroup>, this element is placed outside of your <option>.

Here, this is a dropdown with 2 groups that opens in a new window (hoping it works), is this sort of what you are looking for? :D


<form>
<fieldset>
<select onChange="popup=window.open('','popup');popup.location=options[selectedIndex].value;">
<optgroup label="boys">
<option value="http://">Tim</option>
<option value="http://">John</option>
<option value="http://">Rick</option>
</optgroup>
<optgroup label="girls">
<option value="http://">Jane</option>
<option value="http://">Susan</option>
<option value="http://">Mary</option>
</optgroup>
</select>
</fieldset>
</form>

The action is triggered by the OnChange="" javascript event handler.

pcp71
04-28-2003, 07:56 AM
Perfect, that is exactly what I was looking for

Many Thanks



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum