Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using a combo box to select links 2

Status
Not open for further replies.

Georgews

Instructor
Apr 8, 2001
22
NZ
I am trying to use a combo box to select links. e.g. select New York and the NY page opens. I have the combo in a left frame and want the page o open in the main frame. Have tried the FAQ's to no avail. Any help appreciated. Thanks
 
Okay, here you go:

frameset.html
Code:
<frameset cols=&quot;25%,75%&quot;>
	<frame src=&quot;frame1.html&quot; name=&quot;frame1&quot;>
	<frame src=&quot;frame2.html&quot; name=&quot;frame2&quot;>
</frameset>

frame1.html
Code:
<select name=&quot;DropDownGrp&quot;
Code:
onchange=&quot;parent.frame2.location.href=this.value&quot;
Code:
>
	<option value=&quot;frame2.html&quot;> Home 
	<option value=&quot;[URL unfurl="true"]http://www.lycos.com&quot;>www.lycos.com[/URL]
	<option value=&quot;[URL unfurl="true"]http://www.google.com&quot;>www.google.com[/URL]
	<option value=&quot;[URL unfurl="true"]http://www.yahoo.com&quot;>www.yahoo.com[/URL]
</select>
frame2.html can contain whatever you want.

The &quot;magic&quot; is in blue. Any questions?

-Ron

We all play from the same deck of cards, it's how we play the hand we are dealt which makes us who we are. -Me

murof siht edisni kcuts m'I - PLEH
 
Thanks Darksahdeau - I can see how this is to work. Couple of questions - I have put the combo in a form as it's the only way I can see how at the mo - is this correct? It does get populated by the option value code OK.
In the Onchange line I assume the &quot;this.value&quot; is the name of the page in the site? Simiarly with t address of the option values? Do I use ///folder.filemname for references within the site?
I am using frontpage xp at the moment to build the site.
Cheers
 
Yes, the proper way to do this would be to put the
Code:
<select>
within a form, although it should work without it.

Code:
this.value
means &quot;the value of this control&quot;. The value of a dropdown box is determined by the value property of whichever &quot;option&quot; is currently selected.

You'll just have to test the syntax with regards to local files. You should be able to use relative paths in this instance. Ex:

Code:
<option value=&quot;/testfolder/frame2.html&quot;> Home

I'm not sure how much control FrontPage will give you over the underlying code. I generally don't recommend using that product as it often incorporates a lot of proprietary code. It's a good place to start, if you're just doing a home page. But, if you're planning on developing professionally I'd recommend that you switch to something else.

Personally, I prefer to code everything by hand. Others prefer a WYSIWYG editor similar to FrontPage. For the hand coders, I use HTML-Kit ( For WYSIWYG, I've seen many people recommend Dreamweaver MX ( Generally speaking, you'll pay more for a WYSIWYG editor whereas text editors are usually free.

Either way, if you plan on designing professionally I'd move away from FrontPage.

Good luck,
-Ron

We all play from the same deck of cards, it's how we play the hand we are dealt which makes us who we are. -Me

murof siht edisni kcuts m'I - PLEH
 
Thanks again Darkshadeau - I am using frontpage because I have it - I am thinking about just coding the whole thing by hand. I have used FP to build sites in the past but it has its limitations. Have also used Dreamweaver which gives more flexibility. I use something called EasyHTML (a freebie) when trying to write code. I will have a lookk at HTML-Kit. I will try a form with only the combo in it at see how the code goes with that.
Thanks for all your help
Cheers
George
 
&quot;...Yes, the proper way to do this would be to put the <select> within a form, although it should work without it...&quot;.

This is certainly the case for any browser which is &quot;relaxed&quot; - such as Internet Explorer. Netscape 4.x however, won't even consider displaying INPUT boxes or SELECT elements if they are not defined within <form>...</form> tags. IMHO - It's HTML best practice to always include the FORM tags.

Textpad ( provides color highlighting of tags and includes a whole heap of &quot;plug-ins&quot; for other languages as well - ASP, LotusScript, ...

Pete.


Web Developer / Aptrix CMS (LWWCM) Specialist
w: e: Pete.Raleigh(at)lclimited.co.uk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top