From: janw Date: Fri, 21 Oct 2005 12:10:50 +0000 (+0000) Subject: Added tab-insert for textarea-elements. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=8be8cf9cf102cd74aac2cc67fe0e0883db96db19;p=gosa.git Added tab-insert for textarea-elements. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1656 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/html/include/focus.js b/html/include/focus.js index 954d2f7af..2629d7d86 100644 --- a/html/include/focus.js +++ b/html/include/focus.js @@ -16,7 +16,7 @@ netscape= (ver.charAt(iln+1).toUpperCase() != "C"); function keyPress(DnEvents) { // determines whether Netscape or Internet Explorer - k = (netscape) ? DnEvents.which : window.event.keyCode; + k = (netscape) ? DnEvents.keyCode : window.event.keyCode; if (k == 13) { // enter key pressed if(typeof(nextfield)!='undefined') { if(nextfield == 'login') { @@ -64,6 +64,19 @@ function keyPress(DnEvents) { } } } + } else if (k==9) { + // Tab key pressed + if(netscape) { + if(DnEvents.target.type == 'textarea') { + document.getElementById(DnEvents.target.id).value+="\t"; + return false; + } + } else { + if(window.event.srcElement.type == 'textarea') { + document.getElementById(window.event.srcElement.id).value+="\t"; + return false; + } + } } }