automatic cursor positioning into form field

Issue #18 resolved
Thomas Waldmann repo owner created an issue

when displaying a form, one usually wants to have the cursor positioned in the first form field. e.g. for the login form, it should be in the name field.

we should have some way to mark that field so a generic piece of js will position the cursor there, reusable for every form we have.

Comments (6)

  1. Reimar Bauer

    we should consider to use the html5 attribute autofocus instead of a piece of js The autofocus attribute specifies that the input element should automatically get focus when a page is loaded.

    <form action="demo_form.asp">

    First name:<input type="text" name="fname" autofocus="autofocus" /><br />

    Last name: <input type="text" name="lname" /><br />

    <input type="submit" />

    </form>

    http://www.w3schools.com/html5/att_input_autofocus.asp

  2. Thomas Waldmann reporter
    • changed status to open

    good idea, but same as for every html5 feature: as long as not all major browsers support this, we may need a solution for other browsers also.

    Supported by: FF 4, Opera 10.63, Safari 5, Chrome 7. No bad sideeffects on other browsers.

    As this is a non-essential feature, we maybe could live without autofocus (with unsupporting browsers).

  3. Log in to comment