Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question about html:image tag

 
Vineela Devi
Ranch Hand
Posts: 191
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I have an image in a form.when I press on Alt+N i want to move the focus to that image.How can I do this using AccessKey.

Pls explain with an example.

Regards
Vineela
[ August 25, 2004: Message edited by: Bear Bibeault ]
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64967
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to the HTML/Javascript forum.
 
Julian Kennedy
Ranch Hand
Posts: 823
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This basic HTML code works:

Basically, to use accesskey the element generally needs to be something you can tab to, like a link or a form element. It's also good practice to give an indication of the access key using the title attribute. Note that how the access key is accessed is browser (or OS?) specific. For example, I believe access is via Alt-N on IE/Windows and via Ctrl-N on the Mac.

I don't know how this translates to Struts though.

Jules
[ August 25, 2004: Message edited by: Julian Kennedy ]
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
to avoid using the link you can use

<input type="image" src="eric.gif" accesskey="n">

Eric
 
Vineela Devi
Ranch Hand
Posts: 191
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Thanks for the replies.But what I exactly mean is iam using <html:image> tag but not the <input type = "image"> tag.

So how can I move the focus to the html element referred by this <html:image> tag when I press any keyboard character

Vineela
 
Julian Kennedy
Ranch Hand
Posts: 823
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Struts API docs seem to suggest:

I imagine that's worth a try.

Jules
 
Vineela Devi
Ranch Hand
Posts: 191
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Thanks.And any idea abt html:img tag?

Vineela
 
Julian Kennedy
Ranch Hand
Posts: 823
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I suggest you adapt my basic HTML suggestion to Struts. If you have trouble then post your attempt (perhaps in the Struts forum) and I'm sure you'll get further help.

Jules
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic