Home > osTicket > How to Set Auto Focus on The Username TextBox in Staff Login Form of osTicket

How to Set Auto Focus on The Username TextBox in Staff Login Form of osTicket

Each time I open the staff login form in osTicket, I have to move the mouse’s cursor and then clicking my mouse to the first textbox on that form in order to make it focus then ready to enter the login information. Unfortunately, this condition is really annoying me, although it looks like not too difficult to do this activity. It should be automatically set focus by system each time staff visit the page. So I modify the login form in staff panel in order to set focus automatically each time staff visit that page.

  1. Open /include/staff/login.tpl.php file, and find this code:

    11
    
    <body id="loginBody">

    then replace with this following code:

    11
    
    <body id="loginBody" onload="document.frmLogin.username.focus()">

    Find again this code:

    16
    
    	<form action="login.php" method="post">

    then replace with this following code:

    16
    
    	<form name="frmLogin" action="login.php" method="post">

Now each time you open or visit the login form page in your osTicket system, then you do not have to move your mouse and click the username textbox. Enjoy it!

  • Share/Bookmark
635 views Print This Post Print This Post

  1. March 3rd, 2010 at 17:53 | #1

    Nice artikel broo….

    mau tanya mas? gimana ya cara bikin Read More Disetiap halaman Wordprees???

    blog saya : http://firtstest.wordpress.com/

    saling berbagi ilmu agar ilmu itu bermanfaat….

  2. March 11th, 2010 at 03:05 | #2

    Very well done! Just for the archive: I had posted an almost identical approach in the osTicket forum.

  3. March 11th, 2010 at 22:10 | #3

    I wanted to add a pointer to your solution in my old thread since I think that yours is more elegant than mine but unfortunately, moderaters locked it :(

  4. March 18th, 2010 at 06:59 | #4

    @xrat

    Thanks. You can open a new thread in osTicket forum if you thinks it is necessary. ;)

  1. April 1st, 2010 at 21:28 | #1