By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,853 Members | 1,034 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,853 IT Pros & Developers. It's quick & easy.

pulldown menus

P: n/a
Hi Group...

I'm using this /old/ method of pulldown menus,
is there another (better) way of doing it? Something
that looks better.

<script language="JavaScript">
function fetch(){
var newtemp;
var tempurl;
var x=document.gotoForm.gotoMenu.selectedIndex;
newtemp=document.gotoForm.gotoMenu.options[x].value;
if (newtemp != null) {
location=newtemp;
}
document.gotoForm.gotoMenu.selectedIndex=0;
}
</script>

<form method="post" action="" name="gotoForm">
<select name="gotoMenu" onChange="fetch()">
<option selected>
Site Index&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
</option>
<option value="&nbsp;">
&nbsp;
<option value="index.html">
Home &nbsp; &nbsp; &nbsp; &nbsp;
<option value="about.html">
About Us &nbsp; &nbsp; &nbsp; &nbsp;
<option value="designed_sites.html">
Client Websites &nbsp; &nbsp; &nbsp; &nbsp;
<option value="banners.html">
Banners &nbsp; &nbsp; &nbsp; &nbsp;
<option value="logo.html">
Logos &nbsp; &nbsp; &nbsp; &nbsp;
<option value="secure_pricing.html">
Contact Us &nbsp; &nbsp; &nbsp; &nbsp;
<option value="web_links.html">
Web Links &nbsp; &nbsp; &nbsp; &nbsp;
<option value="credits.html">
Credits &nbsp; &nbsp; &nbsp;
<option value="faq.html">
Frequently Asked Questions&nbsp; &nbsp; &nbsp; &nbsp;
</select>
</form>
Gufus

.... Opportunity always knocks at the least opportune moment.
Sep 8 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Gufus wrote:
Hi Group...

I'm using this /old/ method of pulldown menus,
is there another (better) way of doing it? Something
that looks better.


Yes, a better way is to provide plain old hyperlinks.

In particular *never* have an "onchange" event handler for a SELECT list
that navigates elsewhere. If you do, then a user who uses the keyboard
to tab over to the list and then expects to use the Up and Down keys to
find a destination of interest will instead find himself directed to
another page--most likely the wrong page--the very first time he presses
Up or Down.

Further, you didn't provide a form submission button, so you're
pointlessly preventing someone who doesn't have Javascript activated
from using your site.
Sep 8 '05 #2

P: n/a
Hi Harlan,

Thursday September 08 2005, Harlan Messinger writes to Gufus:
From: hm*******************@comcast.net
Yes, a better way is to provide plain old hyperlinks.
Ok.. but I still want to use pulldown menus on some
of my work. Can you help me out?

IE: Show me specific code, cgi, perl, HTML.. etc...
In particular *never* have an "onchange" event handler for a
SELECT list that navigates elsewhere. If you do, then a user
who uses the keyboard to tab over to the list and then
expects to use the Up and Down keys to find a destination of
interest will instead find himself directed to another
page--most likely the wrong page--the very first time he
presses Up or Down.
Okay...
Further, you didn't provide a form submission button, so
you're pointlessly preventing someone who doesn't have
Javascript activated from using your site.


Okay...

Gufus

mailto:in**@gypsy-designs.com
http://www.gypsy-designs.com

.... People will buy anything that's one to a customer.
Sep 9 '05 #3

P: n/a
NO**********@shaw.ca (Gufus) wrote:
I'm using this /old/ method of pulldown menus,
Now that you've resorted to multiposting I'll attempt to address the
issues. I didn't answer before because looking at your code my heart
sank into my shoes, you seem completely unaware of the fundamental
problems, so I didn't think you'd be willing to accept the solutions.
is there another (better) way of doing it?
Better certainly.
Something that looks better.
How it looks should be the last of your worries.
<script language="JavaScript">
Never rely on optional components such as client side scripting for
anything essential such as navigation. This is a link: <a
href="foo">foo</a>, these are a number of links:

<ul>
<li><a href="foo">foo</a></li>
<li><a href="foo">foo</a></li>
<li><a href="foo">foo</a></li>
<li><a href="foo">foo</a></li>
</ul>
<form method="post" action="" name="gotoForm">


Forms are for user input, not for navigation.

--
Spartanicus
Sep 9 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.