wood burning stoves*
The moose likes HTML, CSS and JavaScript and the fly likes Accelerator/Mnemonics Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Accelerator/Mnemonics" Watch "Accelerator/Mnemonics" New topic
Author

Accelerator/Mnemonics

Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Is there an easy way to create Accelerator or Mnemonic keys on a Web form for the Buttons? I only need to worry about IE if that makes a difference.


GenRocket - Experts at Building Test Data
James Swan
Ranch Hand

Joined: Jun 26, 2001
Posts: 403
I think the attribute is "accesskey"
eg.
<input type="button" accesskey="1" ... />
then you should be able to get to that button with alt-1
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
here is more info on the access key
http://www.w3.org/TR/REC-html40/interact/forms.html#h-17.11.2
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Groovy. Thanks guys.
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Ok, from what I can tell, and a little testing, the only thing an accesskey does for a Button is put focus on the Button. So I would have to do ALT-B and then hit enter. I would like to hit ALT-B and the page be submitted. The only other way I guess is to use an Image for the button and do it as a link because I know an accesskey actually follows the link. But then I don't know if just clicking a link will actually perform a POST for the form.
Anyone have any suggestions?
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Nevermind. I was doing it wrong.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
You can also do it with key codes/ key press and catch it that way..
 
Don't get me started about those stupid light bulbs.
 
subject: Accelerator/Mnemonics