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!

access keys and validation 3

Status
Not open for further replies.

1DMF

Programmer
Jan 18, 2005
8,795
GB
hi,

I've tried to validate my page and am getting the following error
there is no attribute "accesskey". <div id="content" accesskey="s">

so what tag do i need to add for this purpose. I really want it to jump to the div when skipping navigation but obviously this is not allowed.

So what do you suggest.

thanks.
1DMF

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!
 
Hi

Only those accessible with pressing the Tab key can have [tt]accesskey[/tt] attribute.
W3C said:
The following elements support the accesskey attribute: A, AREA, BUTTON, INPUT, LABEL, and LEGEND, and TEXTAREA.
1DMF said:
I really want it to jump to the div when skipping navigation but obviously this is not allowed.
If you want to jump to the [tt]div[/tt], then it is the target, and does not need [tt]accesskey[/tt].

Feherke.
 
Hi

I am not sure if the [tt]id[/tt] alone is understood well enough, I would use traditional [tt]a name[/tt].
Code:
[highlight silver]108[/highlight]			</div>
[highlight silver]109[/highlight]		</div>
[highlight silver][red]new[/red][/highlight]		[red]<a name="content"></a>[/red]
[highlight silver]110[/highlight]		<div id="content" accesskey="s">
[highlight silver]111[/highlight]			<div class="post" id="first">

Feherke.
 
Copied from W3C:

The following elements support the accesskey attribute: A, AREA, BUTTON, INPUT, LABEL, and LEGEND, and TEXTAREA.

You can try it with one of the other tags that are allowed to have accesskeys and put it right above the div id="content".

My first thought is to put a named anchor there and put the accesskey on the anchor, but I'm not sure that's what you want.

Code:
<label accesskey="s"></label>
<div id="content">
[code]


[monkey][snake] <.
 
Heh, well looks like feherke got to it first. I was too busy testing my reply [cry]

[monkey][snake] <.
 
Hi

Well, while we interpreted the situation in different manners, not sure if the speed was the key feature in answering this question.

Anyway, I should note this somewhere. I am not every day faster then you... ;-)

Feherke.
 
I think you're supposed to apply the accesskey to the skip link, not its target. Like this:
Code:
<body>
<a href="#content" accesskey="s">Skip Navigation</a>
<ul id="menu">
<li><a href="/">Home</a></li>
<li><a href="/about.htm">About</a></li>
</ul>
<div id="content">
Blah Blah Blah
... etc ...


-- Chris Hunt
Webmaster & Tragedian
Extra Connections Ltd
 
nothing personal guys, but i've gone with MonkSnake's option.

I hate putting a tag in just for this when an access key on the <div> or even the <h1> would have done the job, jeez even on the <img> would have worked, but hey ho.

I prefer to use a label than an anchor , I never understood the use of an anchor to put a 'name' placeholder on the page, so label to me makes more 'semantic' sense.

plus i could make it a <label for="content"> coz that is exactly what i was using it for, to label the content div so I could jump to it.

so thanks Monksnake!

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!
 
damn it there is always one who comes along and throws a spanner in the works.

would it be better if I added 'Skip Navigation' to my 'helpul links' section?

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!
 
unfortunately Chris made me change it!

check it out , I think it is now correctly implemented!

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!
 
Hi

1DMF said:
would it be better if I added 'Skip Navigation' to my 'helpul links' section?
Yep, right at the end of the navigation links... Why to skip from there ? Put it at the physical beginning of the document, from there is useful to the blind visitor to jump from.

Feherke.
 
doesn't a blind person know that 's' is skip navigation by default if implemented to the standards?

but I hear what your saying, so are you happy now feherke ?







"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!
 
they also don't have an accesskey 0 for access key information. tut tut!

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top