Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I want to creat a web page with 2 frames. The first frame will ahve a combo box where the user selects the page to display in the second frame. How do I do this?
PS: I know how to make frams, but how do I get the selection in the combobox to change the content of the other frame?
-Ryan Adams
Ryan's
Custom Computers

I think you can use javascript for the purpose.
Set the onclick property of the options in the select box to some java script function which then loads the corresponding page in the second frame.
You can use the name of the second frame to refer to it using the javascript.

No, no, no
Name the frame where the pages will load, main
Name the menu frame menu
Do that by putting name="menu" and name"main" in the frame tag. Then make links like
<*a href=page.html target=main>
Without the * of course.
Thats all, no crazy java requiredhttp://excellhosting.net for all your hosting needs.

yes, yes, yes :-)
Chaud's approach works for links, but not for a dropdown box. The code should look something like this: (assuming the names chaud used for the frames)
<SCRIPT language='javascript'>
function switchPages()
{
comboBox=document.getElementById('combo');
top.main.location=comboBox.value;
}
</script>
<SELECT name='combo' onChange='switchPages()'>
<Option value='http://me.com/page1.html'>
<Option value='http://me.com/page2.html'>
</select>

Well he didnt say dropdown, combo could be....a big box with links in it :-P
http://excellhosting.net for all your hosting needs.

Thanks guys. here is what i ended up doing
http://www.pageresource.com/jscript/jdrop3.htm
-Ryan Adams
Ryan's
Custom Computers

That is the same concept as what I said above, except it puts the code in the HTML tags rather than in a function.
The way I did it above also works with older versions of netscape, while the version in your link does not.
-SN

Hey, I tried thi with my iframes site but it doesn't work. DOes this work ith iframes?
The page is at pleth0ra.co.uk/retro
Poor Stevie. They never did find his head.

![]() |
MCAD readiness eval
|
.pfc file conversion for ...
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |