Loading ...
Sorry, an error occurred while loading the content.

Re: [ydn-javascript] backspace on IE and Chrome

Expand Messages
  • andy petrella
    Damn browsers ^^. Thanks, it works fine ! Ndi ... -- Andy Petrella Belgium (Liège) ******** - Graduate in Mathematics - Graduate in Informatics - Software
    Message 1 of 3 , May 29, 2009
    • 0 Attachment
      Damn browsers ^^.

      Thanks, it works fine !

      Ndi

      On Thu, May 28, 2009 at 9:09 PM, Adam Moore <adamoore@...> wrote:
      On Thu, May 28, 2009 at 02:24:50PM -0000, noootsab wrote:
      > Hi Guyz,
      >
      > I'm trying to handle the backspace, tab and enter pressing this way :
      >
      > //this.input is a YAHOO.util.Element
      > this.input.on("keypress", function(e, self) {
      >         var charCode = YAHOO.util.Event.getCharCode(e);
      >         if (charCode == 8) {
      >             //backspace
      >         } else if (charCode == 9) {
      >             //tab
      >         } else if (charCode == 13) {
      >         } else {
      >         }
      >     }, this);
      >
      > This work fine under FF, but under IE and Chrome the 'tab' doens't go trough the "on" method and the backspace as well...
      >
      > How can I handle such keypress under those browsers ? Any ideas ?
      >
      > Thanks in advance.

      There is some inconsistency among the browsers in this area, but
      keystrokes that do not result in a typed character operate during the
      'keydown' event rather than the 'keypress' event.  Try listening to the
      'keydown' event.

      -Adam



      --
      Andy Petrella
      Belgium (Liège)
      ********
      - Graduate in Mathematics
      - Graduate in Informatics
      - Software Engineer at Télémis (http://www.telemis.com)
      ********
      mail :
      - andy.petrella@...
      - andy.petrella@...
      ********
      phone :
      +32495991104
    Your message has been successfully submitted and would be delivered to recipients shortly.