Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Html Grab focus ?

  • 10-11-2005 3:38pm
    #1
    Registered Users, Registered Users 2 Posts: 261 ✭✭


    Anyone know how to grab focus to a html form like google those to its search text box ?

    I tried to view the sourse i cant make much sense of it, I think they might use java script , anyone got any ideas ?


Comments

  • Closed Accounts Posts: 5,372 ✭✭✭The Bollox


    it's a very simple thing, I can't remember what it was, all I know was that it was just a simple command like < align> or something like that


  • Moderators Posts: 6,900 ✭✭✭Spocker


    Add the following in the <body> tag of your page:

    onLoad="document.form.element.focus()"

    where form is the name of the form and element is the name of the element you want the focus to be on.

    HTH

    S.


  • Registered Users, Registered Users 2 Posts: 68,317 ✭✭✭✭seamus


    It's Javascript.

    <body onLoad = "javascript:document.getElementById('myTextField').focus()">


  • Registered Users, Registered Users 2 Posts: 261 ✭✭HaVoC


    sweet thanks guys


Advertisement