Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

andyjamesnelson

macrumors 6502
Original poster
Aug 24, 2003
286
0
Jacob's house
Hey,

So I'm trying to set the tabindex on some form elements:

<form id="form1" action="/" method="post">
<fieldset><legend>Contact form</legend>
<p class="first">
<label for="name">Name</label>
<input type="text" name="name" id="name" size="30" tabindex="101" />
</p>
<p>
<label for="email">Email</label>
<input type="text" name="email" id="email" size="30" tabindex="101" />
</p>
<p>
<label for="web">Website</label>
<input type="text" name="web" id="web" size="30" tabindex="103" />
</p>
</fieldset>
<fieldset>
<p>
<label for="message">Message</label>
<textarea name="message" id="message" cols="30" rows="10" tabindex="104"></textarea>
</p>
<p>
<label for="quantity" tabindex="105">Quantity</label>
<select name="quantity">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
<option>7</option>
<option>8</option>
<option>9</option>
<option>10</option>
</select>
</p>
</fieldset>

<p class="submit"><button type="submit" tabindex="106">Send</button></p>

</form>

The tabindex="" works fine until one gets to the select and submit at witch point it seems to ignore the elements and doesn't focus upon them. Does tabindex work with all form elements?

Thanks,

Andy
 
The following elements support the tabindex attribute: A, AREA, BUTTON, INPUT, OBJECT, SELECT, and TEXTAREA.
More Info Here.

Why are you using <button type="submit" instead of <input type="submit" ? Perhaps the problem is caused by your submit element being outside the fieldset?

I'm just throwing out some ideas....
 
It will also partly depend on the user's setup. Mac has settings for what page elements can be tabbed too. I'm not at my Mac to find the specific settings, but believe it was in the Keyboard section of System Preferences.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.