(page requirements)

Add hot keys to your forms

Are you used to being able to jump from one field to another using hot keys in your regular programs? Now you can add the same functionality to your web page forms to make it easier for your visitors to move between fields.
If you're using Explorer 4.x, you can hit the ALT key and the underlined character of the field title to jump to that field; for example hit ALT+E to get to the email field, ALT+P to get to the password field or ALT+N to get to the user name field.

So how does it work? Let's say you have an input field on your web form called "User Name." To assign ALT+N as its hotkey,
  1. Wrap your field label ("User Name") with <LABEL ...> and </LABEL> tags as follows.
    <LABEL FOR="id" ACCESSKEY="key">
    User Name
    ACCESSKEY parameter should be set to the letter that's combined with the ALT key to create the hotkey (N in this case).
    FOR parameter is the ID of the field that should be highlighted when the hotkey is pressed.
  2. Add ID parameter to your field tag (to the <INPUT ...> tag for example).
    ID should match the name you used in the FOR parameter of the <LABEL ...> tag explained above.
  3. Optionally use <U> and </U> tags to underline the hotletter in the field label. For example to underline N in the field label "User Name"
    User <U>N</U>ame
Here's how the complete HTML tags for the above example should look like.
User <U>N</U>ame:
<INPUT ID="id_name" name="name" TYPE="TEXT">
Listing #1 : HTML code. Download hotkey (0.22 KB).
Another example, in this case to make ALT+E a hot key:
<LABEL FOR="id_email" ACCESSKEY="E">
<U>E</U>-mail address:
<INPUT ID="id_email" name="email" TYPE="TEXT">
Listing #2 : HTML code. Download hotkey2 (0.23 KB).
Applicable Keywords : HTML, Internet Explorer, Explorer 4.x, Internet, World Wide Web
Copyright © 2009 Chami.com. All Rights Reserved. | Advertise | Created in HTML Kit editor