473,408 Members | 1,821 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

How can one put an accesskey on a Select (Drop down box)

Jim
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
Jul 23 '05 #1
3 6148
Jim wrote:
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">


<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
Jul 23 '05 #2
Jim
On Thu, 18 Nov 2004 16:04:19 GMT, Lachlan Hunt wrote:
Jim wrote:
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">


<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>


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
Jul 23 '05 #3
Jim wrote:
On Thu, 18 Nov 2004 16:04:19 GMT, Lachlan Hunt wrote:
<label accesskey="r" for="state">State:</label>
<select tabindex="3" id="state" name="state">
<option>...</option>
</select>

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.


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
Jul 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Nanos | last post by:
For the form I need to create drop down select with say five different options. There also should be possibility to enter own option if one is not listed. How can I do it.? Thank you in advance...
3
by: Matthew Louden | last post by:
if the user select the EmployeeID in drop down list, and then click the submit button, and it will look up database and show the Employee Name in the text box, this is easy. But my case is:...
3
by: Diane Yocom | last post by:
Has anybody ever seen or written code for ASP that would mimic Access' multi-column combo box? Specifically, I have a drop down box that lists about 100 five-digit codes. Each of these codes has...
10
by: Ryan McGeary | last post by:
In a <select> drop-down, the onchange event isn't called when scrolling through the dropdown using the mouse-wheel and when crossing over a new <optgroup>. Using the example below, notice how...
9
by: Udo Marx | last post by:
Greets to ciwah! I'm doing a little webproject for a local session event. Tryin' to meet latest standards i failed to do this: --snip-- <select name="fromcountry" accesskey="l" title="+">...
5
by: Isha | last post by:
Hi all, I wanted to change the background color for only the first option in a select box, but following changed the background color for the whole dropdown box. <select name="alltags"...
3
by: printline | last post by:
Hello All I need some help in a form i'm creating. I have to fields with drop down select boxes. What i want to do is, when a user selects a given value in one drop down, the other drop down...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.