Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 23rd, 2005, 11:45 PM
Jim
Guest
 
Posts: n/a
Default How can one put an accesskey on a Select (Drop down box)

Hi,

How can one put an accesskey on a Select (Drop down box) in a form using
XHTML 1.0? It won¢t validate as follows:

<select accesskey="r" tabindex="3" name="state" size="1">

I can put an accesskey on radio buttons, and text fields without issue.

Thanks

Jim
  #2  
Old July 23rd, 2005, 11:45 PM
Lachlan Hunt
Guest
 
Posts: n/a
Default Re: How can one put an accesskey on a Select (Drop down box)

Jim wrote:[color=blue]
> How can one put an accesskey on a Select (Drop down box) in a form using
> XHTML 1.0? It won₼t validate as follows:
>
> <select accesskey="r" tabindex="3" name="state" size="1">[/color]

<label accesskey="r">State:
<select tabindex="3" name="state">
<option>...</option>
</select>
</label>

Or, if your concerned about the label working properly in IE, then you
have to reference the control with the id, using the for attribute.

<label accesskey="r" for="state">State:</label>
<select tabindex="3" id="state" name="state">
<option>...</option>
</select>

--
Lachlan Hunt
http://lachy.id.au/
http://GetFirefox.com/ Rediscover the Web
http://SpreadFirefox.com/ Igniting the Web
  #3  
Old July 23rd, 2005, 11:46 PM
Jim
Guest
 
Posts: n/a
Default Re: How can one put an accesskey on a Select (Drop down box)

On Thu, 18 Nov 2004 16:04:19 GMT, Lachlan Hunt wrote:
[color=blue]
> Jim wrote:[color=green]
>> How can one put an accesskey on a Select (Drop down box) in a form using
>> XHTML 1.0? It won₼t validate as follows:
>>
>> <select accesskey="r" tabindex="3" name="state" size="1">[/color]
>
> <label accesskey="r">State:
> <select tabindex="3" name="state">
> <option>...</option>
> </select>
> </label>
>
> Or, if your concerned about the label working properly in IE, then you
> have to reference the control with the id, using the for attribute.
>
> <label accesskey="r" for="state">State:</label>
> <select tabindex="3" id="state" name="state">
> <option>...</option>
> </select>[/color]

Thanks, that validated and works. I used your second approach, but used an
empty label as I have the true "State" label in a difference cell.

Jim
  #4  
Old July 23rd, 2005, 11:46 PM
Lachlan Hunt
Guest
 
Posts: n/a
Default Re: How can one put an accesskey on a Select (Drop down box)

Jim wrote:[color=blue]
> On Thu, 18 Nov 2004 16:04:19 GMT, Lachlan Hunt wrote:[color=green]
>><label accesskey="r" for="state">State:</label>
>><select tabindex="3" id="state" name="state">
>> <option>...</option>
>></select>[/color]
>
>
> Thanks, that validated and works. I used your second approach, but used an
> empty label as I have the true "State" label in a difference cell.[/color]

Then put the label the cell where the actual label is. They don't need
to be together as I wrote them, it is fine to seperate them like this,
or any other structure, as long as it conforms to the spec:

<td><label accesskey="r" for="state">State:</label></td>
<td>
<select tabindex="3" id="state" name="state">
<option>...</option>
</select>
</td>


--
Lachlan Hunt
http://lachy.id.au/
http://GetFirefox.com/ Rediscover the Web
http://SpreadFirefox.com/ Igniting the Web
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles