...

View Full Version : Drop down menu - javascript new window



craiggaynor
05-23-2012, 12:28 PM
Hi guys,

I am trying to create a drop down menu which will open a new window when you click on the go button. I'm having trouble getting this to work this is my code:


<FORM NAME="charges">
<SELECT NAME="brands" style="width:190px;">
<OPTION SELECTED><b>Select Brand:</b>

<OPTION VALUE="window.open('/charges/iweb_charges.html','iweb','width=500,height=300,scrollbars=no')"><b>IWEB</a>
<OPTION VALUE="window.open('charges/tmf_charges.html','tmf','width=500,height=300,scrollbars=no')"><b>TMF</a>
<OPTION VALUE="window.open('charges/hsdl_charges.html','hsdl','width=500,height=300,scrollbars=no')"><b>HSDL, BoS & Henderson</a>
<OPTION VALUE="window.open('charges/lbgnom_charges.html','lbg','width=500,height=300,scrollbars=no')"><b>LBG Nominee</a>
<OPTION VALUE="window.open('charges/corpnom_charges.html','corp','width=500,height=300,scrollbars=no')"><b>Corporate Nominee</a>

</select>

<INPUT TYPE="BUTTON" VALUE="Go!" onclick="window.open(document.charges.brands.value,'chargesWindow','width=500 height=300 scrollbars=no resizable=0')">

</FORM></a>

Any suggestions as to what I am doing wrong?

Thanks,
Craig

craiggaynor
05-23-2012, 03:19 PM
I figured it out, if this helps anyone in the future it is:


<FORM NAME="charges">
<SELECT NAME="brands" style="width:175px;">

<OPTION VALUE="hsdl_charges.html"><b>HSDL, BoS & Henderson</a>
<OPTION VALUE="iweb_charges.html"><b>IWEB</a>
<OPTION VALUE="tmf_charges.html"><b>TMF</a>
<OPTION VALUE="corpnom_charges.html"><b>Corporate Nominee</a>
<OPTION VALUE="lbgnom_charges.html"><b>LBG Nominee</a>
</select>

<INPUT TYPE="BUTTON" VALUE="Go!" onclick="window.open('charges/'+charges.brands.value,'chargesWindow','width=550 height=665 scrollbars=no resizable=0')">

</FORM></a>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum