简体   繁体   中英

Zurb foundation tabbing through form fields and buttons

Using Zurb Foundation 5, I have a form

    <form>
        <h2>Add or edit</h2>
            <label for="n_shortname">Name in figure:</label>
            <input type="text" id="n_shortname"/><br>
            <label for="n_phosphorylated">P? (Phosphorylated?)</label>
            <input type="checkbox" id="n_phosphorylated"><br>
        <a class="button" id="save-button">Save</a>
    </form>

When filling out the form, I can use the tab key to move through the inputs, but when I get to the last item (the checkbox) and hit tab, instead of moving focus to the button (so I can "save" by hitting the enter key) the focus goes to the top of the page. How do I make the focus go to the button next?

Figured it out. I changed it to:

    <form>
        <h2>Add or edit</h2>
        <label for="n_shortname">Name in figure:</label>
        <input type="text" id="n_shortname"/><br>
        <label for="n_phosphorylated">P? (Phosphorylated?)</label>
        <input type="checkbox" id="n_phosphorylated"><br>
        <input type="button" class="button" id="save-button" value="Save"></input>
    </form>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM