tabindex problems

Discussion in 'Web Design and Development' started by andyjamesnelson, Sep 22, 2009.

  1. andyjamesnelson macrumors 6502

    Joined:
    Aug 24, 2003
    Location:
    Jacob's house
    #1
    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
     
  2. Darth.Titan macrumors 68030

    Darth.Titan

    Joined:
    Oct 31, 2007
    Location:
    Austin, TX
    #2
    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....
     
  3. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #3
    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.
     

Share This Page