Drop-down Menu
Frame Changer
This script lets a user choose the page
they want to visit from a pulldown menu. You can either set it to change the target
frame onclick or let the user make a choice and click a "Go" button. Check
out the sample below and then view the script that made it possible.
Sample | Back to Web Tips
- Let's assume you have a simple frameset like the one below:
<FRAMESET ROWS="30%,*">
<FRAME SRC="frameA.htm" NAME="frameA">
<FRAME SRC="frameB.htm" NAME="frameB">
</FRAMESET>
- Use the following type of drop down menu in frameA to change
frames onClick:
<form NAME="drop">
<select NAME="down" size="1"
onChange="parent.frameB.location.href = drop.down.options[drop.down.selectedIndex].value;return
false">
<option VALUE="95Net1.htm">95Net 1 </option>
<option VALUE="95Net2.htm">95Net 2 </option>
<option VALUE="95Net3.htm">95Net 3 </option>
</select>
</form>
- Use the following type of drop down menu in frameA to change
frames with a button:
<form name="drop1">
<select NAME="down1" size="1">
<option VALUE="95Net1.htm">95Net 1 </option>
<option VALUE="95Net2.htm">95Net 2 </option>
<option VALUE="95Net3.htm">95Net 3 </option>
</select><input NAME="submit" TYPE="Button"
VALUE="Go"
onClick="parent.frameB.location.href = drop1.down1.options[drop1.down1.selectedIndex].value;return
false">
</form>
- Of course, the select name, form name and option values are up
to you. Just make sure that certain values are repeated as indicated by the colored
text.
Back to Web Tips |