473,399 Members | 3,656 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

acclerator key with input element

I use form and input elements just to create an (ugly) navigation
button. Now, for accessibility, I provide an accelerator key for it so
that the first letter of the value attribute is a link. For example,
This works:

<form">
<input id="button" type="button"
value=" Foo homepage "
accesskey="f"
onClick="parent.location='../index.html'">
</form>

However, the "F" in Foo is not underlined. How can I decorate the "F"
so that the user knows it is an accelerator?

A more general question: anchor elements by default have underlined
content. Given that, how can one distinguish the first letter of the
text to signal the user that it is an accelerator?

--

Haines Brown
KB1GRM
ET1(SS) U.S.S. Irex 482
Mar 23 '06 #1
6 1775
Haines Brown wrote:
I use form and input elements just to create an (ugly) navigation
button. Now, for accessibility, I provide an accelerator key for it so
that the first letter of the value attribute is a link. For example,
This works:

<form">
<input id="button" type="button"
value=" Foo homepage "
accesskey="f"
onClick="parent.location='../index.html'">
</form>
That is ugly. <form action="../index.html" target="_parent"><input
type="submit" ... ></form> wouldn't depend on JavaScript. Using a
regular link would be even better - links go places, forms send stuff
places. Breaking UI conventions doesn't make for a good experience.
However, the "F" in Foo is not underlined. How can I decorate the "F"
so that the user knows it is an accelerator?
Also, by default, in English language browsers, F is often the
accelerator key for the file menu. Breaking access to it isn't a great
idea.
A more general question: anchor elements by default have underlined
content. Given that, how can one distinguish the first letter of the
text to signal the user that it is an accelerator?


There aren't any good ways, and in my experience, accesskeys do more
harm than good.

Mar 23 '06 #2
Haines Brown <br****@teufel.hartford-hwp.com> writes:
I use form and input elements just to create an (ugly) navigation
button. Now, for accessibility, I provide an accelerator key for it so
that the first letter of the value attribute is a link. For example,
This works:

<form">
<input id="button" type="button"
value=" Foo homepage "
accesskey="f"
onClick="parent.location='../index.html'">
</form>

However, the "F" in Foo is not underlined. How can I decorate the "F"
so that the user knows it is an accelerator?
Firstly, what's wrong with
<a href="../index.html" accesskey="f">Foo homepage</a>
If you really want it to look like an ugly button it's possible to
style it as one.

Secondly, the implementation of accesskey in Internet Explorer and the
Mozilla-based browsers is very bad - accesskey="f" will generally be
activated with 'Alt-F'. 'Alt-F' in normal circumstances [1] opens the
browser's "File" menu. To make it even more confusing, in one of IE
and Mozilla, Alt+F simultaneously will activate the accesskey, but
Alt,F will activate the menu.

Use of numeric accesskey values mostly gets around the conflict
problem (though on my machine Alt-number is intercepted by the window
system and never even reaches the browser) but replaces it by the
accesskeys being entirely unintuitive.v

[1] And English language settings. In other languages it might open a
different menu.
A more general question: anchor elements by default have underlined
content. Given that, how can one distinguish the first letter of the
text to signal the user that it is an accelerator?


Use bold, italics, or some other styling instead?

Better still, lobby the browser developers to make the browser display
accesskey definitions in an appropriate and standard way (e.g. an
extra bar at the side or top of the browser, or something that pops up
when the access key prefix is pressed) and also to use an activation
key for them that doesn't conflict with other browser functions.

--
Chris
Mar 23 '06 #3
try
<button accesskey="F" onclick="alert('foo')"><span
style="text-decoration:underline">F</span>oo</buttoN

Mar 23 '06 #4
I wish to thank those who so kindly offered advice on button design. I
decided to avoid improver use of form elements, and the accelerator
key issue just ended up too complicated. So instead I just created a
CSS button and left it at that. Anything wrong with this? (I have
utilitarian pages and so don't mind a utilitarian ugly button).

#bttn {
padding:0;
margin:3px 0;
text-align: center;
background:#cacaca;
width: 120px; /* define width */
font-size: smaller;
font-family: sans-serif;
}
#bttn span { border:1px solid #000; }
#bttn #c {padding:1px 0;}
#bttn span {display:block;}
#bttn a, #bttn a:visited { /* visited not distinguished */
display:block;
width:100%;
border:1px solid #000;
color: blue;
text-decoration:none;
}
#bttn #a {border-color:#dddddd #696969 #696969 #dddddd;}
#bttn #b {border-color:#d7d7d7 #898989 #898989 #d7d7d7;}
#bttn #c {border-color:#d0d0d0 #aaaaaa #aaaaaa #d0d0d0;}
#bttn a:hover {
background:#bababa;
color:#000;}
#bttn a:hover #a {
display:block;
border-color:#696969 #dddddd #dddddd #696969;
}
#bttn a:hover #b {
display: block;
border-color: #898989 #d6d6d6 #d7d7d7 #898989;
}
#bttn a:hover #c {
display: block;
border-color: #aaaaaa #d0d0d0 #d0d0d0 #aaaaaa;
padding:2px 0 0 0;
}
</style>
</head>
<body>

<div id="bttn">
<a href="target-test.html" title="">
<span id="a">
<span id="b">
<span id="c">
Target page
</span>
</span>
</span>
</a>
</div>

--

Haines Brown
KB1GRM
ET1(SS) U.S.S. Irex 482
Mar 24 '06 #5
Chris Morris wrote:
Use of numeric accesskey values mostly gets around the conflict
problem (though on my machine Alt-number is intercepted by the window
system and never even reaches the browser) but replaces it by the
accesskeys being entirely unintuitive.


I dunno. Is Alt+1 => home that unintuitive?

(OK, so maybe the other numbers can be, but there are fairly
well-established conventions on numeric access keys that can help.)

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact

Mar 25 '06 #6
Toby Inkster <us**********@tobyinkster.co.uk> writes:
Chris Morris wrote:
Use of numeric accesskey values mostly gets around the conflict
problem (though on my machine Alt-number is intercepted by the window
system and never even reaches the browser) but replaces it by the
accesskeys being entirely unintuitive.
I dunno. Is Alt+1 => home that unintuitive?


It's "Switch to Heading browsing mode" in IBM Home Page Reader.
(OK, so maybe the other numbers can be, but there are fairly
well-established conventions on numeric access keys that can help.)


The problem with these conventions is that they aren't all that
generally applicable [1]. There's also several separate ones, and Home=1
is the only universal one. (List accesskeys => 0 seems common, though)

[1] UK gov convention has '7' as complaints procedure. Outside of
government is it really necessary to take an access key for that
*separate* to the contact form, the FAQ page, and the help page?

--
Chris
Mar 25 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Csaba2000 | last post by:
I want to be able to programatically click on the center of an <INPUT type=image ...> element (I only care about IE 5.5+). This should work regardless of whether IE has focus. Normally you would...
2
by: kie | last post by:
hello, when i create elements and want to assign events to them, i have realised that if the function assigned to that element has no parameters, then the parent node values can be attained. ...
2
by: Kai Grossjohann | last post by:
I would like to put a text input field (in the sense of <input type="text">) and an image next to each other, where I know the size in pixels of the image, and I know the total width in em. I...
5
by: Mikko Rantalainen | last post by:
See example at <URL:http://www.cc.jyu.fi/~mira/moz/formtest.php>. The problem is that the label of submit button is always centered on the button regardsless of 'text-align' property in CSS....
5
by: Gregg | last post by:
Hello all, I have been banging my head over a problem that I am having reading a comma seperated file (CSV) that can contain from 1 to 10,000 records. My code snipit is as follows: **Start...
4
by: multimatum2 | last post by:
Hello, I need to enable/disable input text forms... But... I need to have the same style (color...) in both modes.. Could you help me ? Thanx a lot A small sample... ...
3
by: Jonathan | last post by:
Hi all: I originally posted this in an HTML forum, but have realized that the solution may (a) require a server-side change or (b) be non-existent. In any case, since the page I'm dealing with is...
2
by: yawnmoth | last post by:
Say I have two input elements and that I wanted to make it so that when the first ones input was what it should be, the focus would automatically be shifted to the next input element. ie....
11
by: C.W.Holeman II | last post by:
I what to hide an input element and the following text. I have the selector for the input working and just need to grab the text following it. CSS: form{ display:table; text-align:center; }
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.