views:

371

answers:

3

How do I do it? I've tried setting the tabindex attribute to no avail.

A: 

Please post your code. Here's an example from the w3c (http://www.w3.org/TR/html401/interact/forms.html#h-17.10):

<FORM action="..." method="post">
 <P>
 <FIELDSET>
  <LEGEND>Personal Information</LEGEND>
  Last Name: <INPUT name="personal_lastname" type="text" tabindex="1">
  First Name: <INPUT name="personal_firstname" type="text" tabindex="2">
  Address: <INPUT name="personal_address" type="text" tabindex="3">
  ...more personal information...
 </FIELDSET>
 <FIELDSET>
  <LEGEND>Medical History</LEGEND>
  <INPUT name="history_illness" 
         type="checkbox" 
         value="Smallpox" tabindex="20"> Smallpox
  <INPUT name="history_illness" 
         type="checkbox" 
         value="Mumps" tabindex="21"> Mumps
  <INPUT name="history_illness" 
         type="checkbox" 
         value="Dizziness" tabindex="22"> Dizziness
  <INPUT name="history_illness" 
         type="checkbox" 
         value="Sneezing" tabindex="23"> Sneezing
  ...more medical history...
 </FIELDSET>
 <FIELDSET>
  <LEGEND>Current Medication</LEGEND>
  Are you currently taking any medication? 
  <INPUT name="medication_now" 
         type="radio" 
         value="Yes" tabindex="35">Yes
  <INPUT name="medication_now" 
         type="radio" 
         value="No" tabindex="35">No

  If you are currently taking medication, please indicate
  it in the space below:
  <TEXTAREA name="current_medication" 
            rows="20" cols="50"
            tabindex="40">
  </TEXTAREA>
 </FIELDSET>
</FORM>
A: 

If you know of a (preferably simple) page where this works, you might want to take a look at their source.

Also, are you sure your HTML document has the keyboard focus when trying? I'm asking because I seem to recall I can navigate to such elements with TAB in plain HTML pages where I did nothing to indicate tab order or similar.

Bandi-T
+1  A: 

If you're using a Mac, you need to open the Keyboard preference panel, switch to the Keyboard Shortcuts tab and select:

"press Tab to move the keyboard focus between: (x) All controls"
Gareth
Yeah, it's a mac thing. Not possible to do it with Javascript I guess.
Jonathan Hawkes