|Subject:||Using keyboard keys to activate buttons|
|Posted by:||MikeB (MPBre…@gmail.com)|
|Date:||Tue, 6 May 2008|
Can I create a form where the user can simply hit the "1" key on the
keyboard and a button click for a specific button on the form is
As an exercise we had a form that had two input fields and one could
press a button and the contents of the two fields would be added
I thought it would be interesting to write an entire calcualtor
(similar to the one that comes with Windows) as an HTML page.
I got most of it right, I have buttons and an input field and buttons
to do the calculations.
What I was hoping to do as the cherry on top was to enable it for
keyboard access, so a user could press the keys (1, 2, 3 etc.) to
enter the values and then the calcualtion key (+, -, *, etc) without
having to click on each button.
I found that I could specify access keys in the HTML, but that works
In Firefox, it doesn't seem to work at all.
In IE, if I press Alt+1, it will cycle through (and enter) either 1,
2, or 3 (the three buttons I've defined accesskey values for).
Thanks for reading