Displaying the access key assignments


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Displaying the access key assignments

  1. #1
    Sunil Menon Guest

    Displaying the access key assignments


    Dear All,
    One cannot rely on browsers displaying the access key assignments (at present
    or in the near future). To clarify the situation, consider the following
    example given in the HTML 4.0 specification:
    <LABEL for="fuser" accesskey="U">
    User Name <INPUT type="text" name="user" id="fuser"> </LABEL>
    On your current browser, this looks like the following:

    User Name

    The specification seems to suggest that a browser should automatically indicate
    to the user that "U" is an accesskey for the input field, e.g. by underlining
    that character (assumably as it appears within the LABEL element). But although
    IE supports (from version 4.0 onwards) ACCESSKEY, there's no underlining
    in the presentation. In fact there is no evidence of real support to LABEL.
    It is also debatable whether the specification really suggests what it seems
    to be suggesting--that browsers should, in a case like this, check the content
    of the LABEL field and underline (any?) occurrence of the accesskey character!

    Thus it seems that the author should take care of the underlining or other
    specific presentation, e.g. writing the content of LABEL in this case as

    <U>U</U>ser Name
    Such explicit presentational suggestions may become unnecessary in the future
    if the browser support improves, of course. But for the time being, we need
    to consider how to present them.
    To let users benefit from access keys, you need to take care of displaying
    the access key assignments.
    The method used in the examples above--explicitly telling the access key
    after an element, and additionally bolding the access key letter when applicable--is
    somewhat naivistic but it can reasonably be expected to carry the message
    to those who need it. The main problem with it would probably not be the
    naivity but the fact that a reference to access keys might confuse people
    who do not need that information. They might have difficulties in understanding
    whether "accesskey" is something they need to know about. You might consider
    making that word a link to a suitable document about access keys. (The present
    document of mine can be used for the purpose, although it would probably
    be all too detailed for that.)
    For normal submit (or reset) buttons in forms, underlining and bolding are
    impossible, since the text in a button is specified using an attribute, and
    attribute values cannot contain HTML markup. Thus, for example, if you have

    <INPUT TYPE="SUBMIT" VALUE="Add this" ACCESSKEY="A">
    then you cannot underline or bold the letter "A" in "Add this". Theoretically,
    you could use INPUT TYPE="IMAGE" and an image which contains the text "Add
    this" with A underlined (and/or bolded), but in practice image buttons cause
    more problems than they might solve. Since the use of uppercase alone is
    not a very good signal--even if you otherwise use all lowercase in submit
    button texts--it seems to be necessary to include an explicit remark about
    the access key.

    Does anyone know how to do it on a Submit button?....it will be a miracle
    and quite a challenge I guess...:-)

    Thanks & Regards
    Sunil

  2. #2
    Xin Li Guest

    Re: Displaying the access key assignments


    Well, I don't know if there is actually a way to add the underline to the
    actual submit button. But, what you might consider doing, which is not necessarily
    any easier than an <image>, is to use an anchor tag, and apply stylesheets
    and some javascript to it, so that its borders are of the style outset, and
    then have it depress when the mouse is down.

    Xin Li
    "Sunil Menon" <sunil@itb-germany.com> wrote:
    >
    >Dear All,
    > One cannot rely on browsers displaying the access key assignments (at present
    >or in the near future). To clarify the situation, consider the following
    >example given in the HTML 4.0 specification:
    ><LABEL for="fuser" accesskey="U">
    >User Name <INPUT type="text" name="user" id="fuser"> </LABEL>
    >On your current browser, this looks like the following:
    >
    >User Name
    >
    >The specification seems to suggest that a browser should automatically indicate
    >to the user that "U" is an accesskey for the input field, e.g. by underlining
    >that character (assumably as it appears within the LABEL element). But although
    >IE supports (from version 4.0 onwards) ACCESSKEY, there's no underlining
    >in the presentation. In fact there is no evidence of real support to LABEL.
    >It is also debatable whether the specification really suggests what it seems
    >to be suggesting--that browsers should, in a case like this, check the content
    >of the LABEL field and underline (any?) occurrence of the accesskey character!
    >
    >Thus it seems that the author should take care of the underlining or other
    >specific presentation, e.g. writing the content of LABEL in this case as
    >
    ><U>U</U>ser Name
    >Such explicit presentational suggestions may become unnecessary in the future
    >if the browser support improves, of course. But for the time being, we need
    >to consider how to present them.
    >To let users benefit from access keys, you need to take care of displaying
    >the access key assignments.
    >The method used in the examples above--explicitly telling the access key
    >after an element, and additionally bolding the access key letter when applicable--is
    >somewhat naivistic but it can reasonably be expected to carry the message
    >to those who need it. The main problem with it would probably not be the
    >naivity but the fact that a reference to access keys might confuse people
    >who do not need that information. They might have difficulties in understanding
    >whether "accesskey" is something they need to know about. You might consider
    >making that word a link to a suitable document about access keys. (The present
    >document of mine can be used for the purpose, although it would probably
    >be all too detailed for that.)
    >For normal submit (or reset) buttons in forms, underlining and bolding are
    >impossible, since the text in a button is specified using an attribute,

    and
    >attribute values cannot contain HTML markup. Thus, for example, if you have
    >
    ><INPUT TYPE="SUBMIT" VALUE="Add this" ACCESSKEY="A">
    >then you cannot underline or bold the letter "A" in "Add this". Theoretically,
    >you could use INPUT TYPE="IMAGE" and an image which contains the text "Add
    >this" with A underlined (and/or bolded), but in practice image buttons cause
    >more problems than they might solve. Since the use of uppercase alone is
    >not a very good signal--even if you otherwise use all lowercase in submit
    >button texts--it seems to be necessary to include an explicit remark about
    >the access key.
    >
    >Does anyone know how to do it on a Submit button?....it will be a miracle
    >and quite a challenge I guess...:-)
    >
    >Thanks & Regards
    >Sunil



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center