File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes Question about html:image tag Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Question about html:image tag" Watch "Question about html:image tag" New topic
Author

Question about html:image tag

Vineela Devi
Ranch Hand

Joined: Dec 20, 2003
Posts: 191
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

Joined: Jan 10, 2002
Posts: 60740
    
  65

Moving to the HTML/Javascript forum.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Julian Kennedy
Ranch Hand

Joined: Aug 02, 2004
Posts: 823
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

Joined: Nov 08, 2001
Posts: 15376
    
    6
to avoid using the link you can use

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

Eric
Vineela Devi
Ranch Hand

Joined: Dec 20, 2003
Posts: 191
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

Joined: Aug 02, 2004
Posts: 823
The Struts API docs seem to suggest:

I imagine that's worth a try.

Jules
Vineela Devi
Ranch Hand

Joined: Dec 20, 2003
Posts: 191
Hi,

Thanks.And any idea abt html:img tag?

Vineela
Julian Kennedy
Ranch Hand

Joined: Aug 02, 2004
Posts: 823
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Question about html:image tag
 
Similar Threads
Posting to bump up my count...
Text box value is not being completely filled with request attribute
WA #1.....word association
Cant use object from another class
The x900 effect ?