Auto-focus on forms

With this mod, when you open a page with a form, the cursor will jump into the form automatically, so you can start typing without having to select the form first.

Fast Reply

To let your users' cursor automatically jump to the fast reply field when the open it, go to Look & Feel in your ACP, open the skin group "Topic View", edit the template bit "quick_reply_box_closed" and add at the end of the link's href attribute:


Your final code should look similar to this:

<a href="javascript:ShowHide('qr_open','qr_closed'); document.getElementById('fast-reply_textarea').focus();" title="{$this->ipsclass->lang['qr_open']}" accesskey="f"><{T_QREPLY}></a>

Other forms

  1. Open the 'Board Header & Footer Wrapper' of your skin
  2. After "<% JAVASCRIPT %>", add:
    <script type="text/javascript">
    // - auto-focus on form fields
    var nk_autofocus = false;
    var nk_is_rte = false;
    function setAutoFocus(e, force, rte) { if(nk_autofocus === false || force) { nk_autofocus = e; nk_is_rte = !!rte; } }
    function checkAutoFocus() {
        if(nk_autofocus !== false) {
            if(nk_is_rte) {
            } else {
                var e = document.getElementById(nk_autofocus);
                if(e) e.focus();
  3. And after "<body", add:
  4. The final code should look more or less like this:
    <% JAVASCRIPT %>
    <script type="text/javascript">
    <body onload="checkAutoFocus()">
  5. Open the skin group 'Post / PM Editor' of your skin and edit the template bit 'ips_editor'
  6. At the top, add:
    <script type="text/javascript">if($rte_mode == 1) setAutoFocus('{$editor_id}', false, true); else setAutoFocus('{$editor_id}_textarea'); </script>
  7. Open the skin group 'Messenger' of your skin and edit the template bit 'topictitle_fields'
  8. At the top, add:
    <script type="text/javascript">setAutoFocus('entered_name');</script>
  9. Open the skin group 'Post Screen' of your skin and edit the template bit 'topictitle_fields'
  10. At the top, add:
    <script type="text/javascript">setAutoFocus('TopicTitle');</script>
  11. Find:
    <input type="text" size="50" maxlength="{$this->ipsclass->vars['topic_title_max_len']}" name="TopicTitle" value="{$data['TITLE']}" tabindex="1" />
  12. And change to:
    <input type="text" size="50" maxlength="{$this->ipsclass->vars['topic_title_max_len']}" name="TopicTitle" id="TopicTitle" value="{$data['TITLE']}" tabindex="1" />
  13. Now every time you visit the new topic, reply or write PM page, your cursor should be focused on the first form field and you can start typing immediately.


    If you liked my modifications, please link back to this site (!

    Last updated

    This site was last updated 2008-03-29.