[Home]WikiPatches/AutoFocusEditText

UseModWiki | WikiPatches | RecentChanges | Preferences

It is just a small Javascript hack, but I thought it might be worth sharing.

What it does:

Upon loading the document the edit box is automatically focussed. This allows you to start typing without a click into the edit-box.

The code:

 
$UserHeader  = <<AUTOFOCUSJAVASCRIPT;
  <script language="JavaScript" type="text/javascript">
    function onLoad(){
       document.getElementsByName("text")[0].focus();
    }
  </script>
AUTOFOCUSJAVASCRIPT
 
$UserBody    = 'onload="onLoad()"'; # Optional <BODY> tag additional content 

Credits:

The idea was taken from http://dict.leo.org (a german <-> english dictionary) and modified to work with Usemod 1.0 by [Christopher Özbek].


UseModWiki | WikiPatches | RecentChanges | Preferences
Edit text of this page | View other revisions | Search MetaWiki
Last edited June 5, 2010 8:58 am by g224250041.adsl.alicedsl.de (diff)
Search: