View Single Post
  #8  
Old 09-26-2007, 12:59 PM
Dok's Avatar
Dok Dok is offline
Expector of Objects
 
Join Date: Sep 2006
Location: Copenhagen, Denmark
Posts: 1,252
Here is a workaround for the tab key in Opera
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
 "http://www.w3.org/TR/html4/strict.dtd">
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>Testing events on TEXTAREA’s</title>
    <script type="text/javascript">
    <!-- begin hiding
      function handleBlur(e) {
        if (this.lastKey == 9)
          this.focus();
      }
      
      function handleKeyDown(e) {
        this.lastKey = e.keyCode;
      }
      
      function handleFocus(e) {
        this.lastKey = null;
      }
    
      window.onload = function() {
        var elm = document.getElementById('myTextarea');
        elm.onfocus = handleFocus;
        elm.onblur = handleBlur;
        elm.onkeydown = handleKeyDown;
      };
    // end hiding -->
    </script>
  </head>
  <body>
    <textarea cols="60" rows="20" id="myTextarea"></textarea>
    <input class="textfield" type="text" size="20">
  </body>
</html>
__________________
#define question (2B || !2B)
HTMLElement and W3C Event Handling in IE
My JavaScript Library

Don't PM me about answers to questions. If I don't reply in a thread it's because:
  • You didn't read the message posting guidelines
  • Your code is too unstructured and/or formatted poorly - correcting it is too time consuming
  • I simply don't know the answer

Last edited by Dok; 09-26-2007 at 01:02 PM.
Reply With Quote