Computing.Net > Forums > Programming > Javascript Drop Down Menu.....

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Javascript Drop Down Menu.....

Reply to Message Icon

Name: jb60606
Date: August 19, 2003 at 18:45:56 Pacific
OS: Windows2003 ES
CPU/Ram: some Ghz
Comment:

Hi,

I created a drop down menu using java script for users to be able to select certain documents. The page the menu is located is a two frame page.

--frame #1 holds the drop down menu

--frame #2 is supposed to display the document they chose from the drop down menu.

How do I tell Javascript to send the document selected in the frame1 drop down, to frame 2?

Below is the code:


Wisdom Archive


Issue #1
Issue #2
Issue #3


Thanks in advance.
Jason



Sponsored Link
Ads by Google

Response Number 1
Name: jb60606
Date: August 19, 2003 at 18:46:50 Pacific
Reply:

Ok, I guess it wont let me display the code.


0

Response Number 2
Name: Infinite Recursion
Date: August 19, 2003 at 18:57:33 Pacific
Reply:

You can use the code converter on the post confirmation page to display your code.


0

Response Number 3
Name: jb60606
Date: August 19, 2003 at 19:03:14 Pacific
Reply:

Wisdom Archive

Issue 
#1

Issue 
#2

Issue 
#3



0

Response Number 4
Name: jb60606
Date: August 19, 2003 at 19:05:21 Pacific
Reply:

doh


Wisdom Archive


Issue #1
Issue #2
Issue #3


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Wisdom Archive</title>
<meta http-equiv="Content-Type" content="text/html; 
charset=iso-8859-1">
</head>

<body>
<div align="center">

<form name="jump">
<select name="menu">
<option value="http://www.wealthyapple.com/newsletter/030804/030711main.htm">Issue 
#1</option>
<option value="http://www.wealthyapple.com/newsletter/052503/030525main.htm">Issue 
#2</option>
<option value="http://www.wealthyapple.com/newsletter/030804/030711main.htm">Issue 
#3</option>
</select>
<input type="button" onClick="location=document.jump.menu.options[document.jump.menu.selectedIndex].value;" 
value="GO">
</form>
</div>
</body>
</html>


0

Response Number 5
Name: SN
Date: August 19, 2003 at 19:45:47 Pacific
Reply:

Frameset (note ID attributes)
<html>
<head>
<title>mypage</title>
</head>

<frameset cols="110,*" frameborder=no border="0">
<frame name="left" ID="left" src="side.html" marginwidth="0" 
marginheight="0" scrolling="no">
<frame name="right" ID="right" src="body.html"  marginwidth="0" 
marginheight="0" scrolling="auto">
<noframes><body>Viewing this page requires a frames 
capable brower.
</body>
</noframes>
</frameset>
<body>
</body>
</html>


Corrected Javascript for side.html (top.right.location rather than just location)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 

<html> 
<head> 
<title>Wisdom Archive</title> 
<meta http-equiv="Content-Type" content="text/html; 

charset=iso-8859-1"> 
</head> 

<body> 
<div align="center"> 

<form name="jump"> 
<select name="menu"> 
<option value="http://www.wealthyapple.com/newsletter/030804/030711main.htm">Issue 

#1</option> 
<option value="http://www.wealthyapple.com/newsletter/052503/030525main.htm">Issue 

#2</option> 
<option value="http://www.wealthyapple.com/newsletter/030804/030711main.htm">Issue 

#3</option> 
</select> 
<input type="button" onClick="top.right.location=document.jump.menu.options[document.jump.menu.selectedIndex].value;" 

value="GO"> 
</form> 
</div> 
</body> 
</html> 

This worked for me.
I assume We don't have to lecture you on the dangers of using this approach to navigation...Use only if you don't care about search engines being able to crawl your page.

-SN


0

Related Posts

See More



Response Number 6
Name: Infinite Recursion
Date: August 19, 2003 at 20:46:59 Pacific
Reply:

SN got to this before me... I use the same method. He is right... bad mojo will be cast upon you and your website if you use frames and hope to have a search engine index the main page and not just one frame. Frames are best used around the intrAnet or personal projects.

Infinite Recursion


0

Response Number 7
Name: SN
Date: August 19, 2003 at 20:58:07 Pacific
Reply:

Actually, I was referring to the other danger...Using a dropdown menu for navigation...Since the links are in javascript, search engines' pattern recognition doesn't recognize them as links, so they don't get followed. The biggest problem I've had with search engines and frames is that they index the page without the frameset, so when somebody goes to your page from a search engine, there is no frameset so they can't navigate. This is fixable by a quick javascript.

I wasn't aware search engines had a hard time crawling frames in the first place; I always assumed it just found every document in the frameset and crawled each one separately...This is something I'll have to consider. I'm glad you posted.
-SN


0

Response Number 8
Name: jb60606
Date: August 20, 2003 at 00:38:32 Pacific
Reply:

Thanks SN and Infinite Recursion, and thanks for the code. It worked perfectly. I was expecting to get chewed out for not trying to hack it myself. I just dont know JavaScript, nor much programming in general other than a couple simple languages.

I was made aware of the threat having this code on the website could bring. However, as of right now, the website owner just wants to see how it "looks".

Does anyone have any suggestions for alternatives for web navigation. Yes, I'm new to web design as well. I was thinking of building a complete Flash/ColdFusion site, if that's any safer at all.

Jason


0

Response Number 9
Name: SN
Date: August 20, 2003 at 10:02:38 Pacific
Reply:

I am a fan of the other kind of dropdown menus, like that at www.sharingds.org. Other people like pull down menus, the kind at microsoft.com.

I'm not sure, but I think building a website in Flash would be even worse for a search engine to follow. Not to mention it's annoying when the whole thing is flash and takes forever to download.

Stick with HTML and javascript, your users will appreciate it.

-SN
P.S. Nobody chewed you out because you had a well defined problem and had included the source code of what you had already done. We mostly only chew out homework posters who just copy and paste their assignments.


0

Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

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


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Javascript Drop Down Menu.....

adding drop down menu to macro www.computing.net/answers/programming/adding-drop-down-menu-to-macro/11761.html

perl drop down menu Oracle www.computing.net/answers/programming/perl-drop-down-menu-oracle/7198.html

Excel drop down menu's www.computing.net/answers/programming/excel-drop-down-menus/609.html