472,956 Members | 2,705 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,956 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 wont 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 6125
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...
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

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.