Click to See Complete Forum and Search --> : target frame w/ drop down menu


juicemaneyebrow
06-16-2005, 08:05 PM
hello. i want my drop down menu to target the "mainFrame" of my site. below is my code- is there an easy way i can fix this by adding target=mainFrame somewhere or soemthing?? please help, thank you.



<td height="42" valign="top"><form name="corpform">
<div align="left">
<select style="font-size:10px;color:#ffffff;font-family:verdana;background-color:#000000;" name="menu">
<option value="360web.htm">360.web</option>
<option value="pluto.htm">pluto</option>
<option value="monroe.htm">monroe</option>
<option value="promotor.htm">promotor</option>
<option value="mhinge.htm">m.hinge</option>
<option value="xycom.htm">xycom</option>
<option value="millerdial.htm">miller.dial</option>
<option value="libertyloan.htm">liberty.loan</option>
<option value="pilates.htm">pilates</option>
</select>
<input name="button" type="button" style="font-size:10px;color:#ffffff;font-family:verdana;background-color:#333333;" onClick="window.open(document.corpform.menu.options[document.corpform.menu.selectedIndex].value);"value="view">
</div>
</form>

Ultimater
06-16-2005, 08:49 PM
top.frames["mainFrame"].location.href=
document.corpform.menu.options[document.corpform.menu.selectedIndex].value

juicemaneyebrow
06-18-2005, 03:25 PM
thanks so much for the reply. so where do i put that code? i couldent get it working..

Ultimater
06-19-2005, 12:18 AM
onClick="..."

"mainFrame" is the name of the frame you are trying to refer to, correct?
If you meant the top menu, then:
top.location.href=document.corpform.menu.options[document.corpform.menu.selectedIndex].value

juicemaneyebrow
06-20-2005, 03:45 PM
yes. mainFrame is the frame i want to target. is this how the code should look then:

onClick="top.frames["mainFrame"].location.href=document.corpform.menu.options[document.corpform.menu.selectedIndex].value"value="view">

with that code it makes my "view" button short w/ no text and it dosent work then. what am i doing wrong?

Ultimater
06-20-2005, 04:34 PM
Almost, you double nested your quotes.

onClick='top.frames["mainFrame"].location.href=document.corpform.menu.options[document.corpform.menu.selectedIndex].value' value="view">

juicemaneyebrow
06-20-2005, 05:57 PM
Yes! it works..thank you so much.