Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #12883

Re: onkeydown and onkeyup

From "J.R." <groups_jr-1@yahoo.com.br>
Newsgroups comp.lang.javascript
Subject Re: onkeydown and onkeyup
Date 2012-03-18 13:07 -0300
Organization Aioe.org NNTP Server
Message-ID <jk5174$thu$1@speranza.aioe.org> (permalink)
References <fva0m7pct2kfuppli6otfhu6emoeqs6sd2@4ax.com> <jjrlj7$di9$1@speranza.aioe.org> <2eu2m718r5tn1jp7uah2dsv3aa8gj3gi6q@4ax.com> <97a3ca53-f073-4409-abb1-da50fb5cdd2a@a20g2000yql.googlegroups.com> <fc24m71e51g23002bfev0diu0ougats06a@4ax.com>

Show all headers | View raw


On 15/03/2012 12:25, Gene Wirchenko wrote:
> On Wed, 14 Mar 2012 22:40:07 -0700 (PDT), David Mark
> <dmark.cinsoft@gmail.com>  wrote:
>
>> On Mar 15, 1:13 am, Gene Wirchenko<ge...@ocis.net>  wrote:
>
> [snip]
>
>>>       I can filter<Enter>  in IE 9.  I want to avoid having a form be
>>> submitted that way.
>>
>> No you don't (you just think you do). Leave it alone.
>
>       Since my code can pick up the character, I think I can filter it.
> Since I do not actually submit at this point, I could be erring there,
> but not on the filtering.

According to MSDN 
<http://msdn.microsoft.com/en-us/library/ms536939.aspx>, as of MSIE 4 
the onkeypress event fires and can be canceled for the following keys:
  * Letters: A - Z (uppercase and lowercase)
  * Numerals: 0 - 9
  * Symbols: ! @ # $ % ^ & * ( ) _ - + = < [ ] { } , . / ? \ | ' ` " ~
  * System: ESC, SPACEBAR, *ENTER*

So as of MSIE 4+ the onkeypress event doesn't fire for the TAB and 
BACKSPACE keys, unlike Firefox for instance. That's why I prefer 
filtering the whole input value attribute instead of checking each key 
being pressed by the user.

-- 
Joao Rodrigues (J.R.)

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

onkeydown and onkeyup Gene Wirchenko <genew@ocis.net> - 2012-03-13 22:35 -0700
  Re: onkeydown and onkeyup David Mark <dmark.cinsoft@gmail.com> - 2012-03-13 22:40 -0700
  Re: onkeydown and onkeyup Norman Peelman <npeelmandog@cfl.rr.com> - 2012-03-14 17:59 -0400
    Re: onkeydown and onkeyup David Mark <dmark.cinsoft@gmail.com> - 2012-03-14 15:10 -0700
      Re: onkeydown and onkeyup Gene Wirchenko <genew@ocis.net> - 2012-03-14 17:57 -0700
        Re: onkeydown and onkeyup David Mark <dmark.cinsoft@gmail.com> - 2012-03-14 19:39 -0700
  Re: onkeydown and onkeyup "J.R." <groups_jr-1@yahoo.com.br> - 2012-03-14 23:53 -0300
    Re: onkeydown and onkeyup David Mark <dmark.cinsoft@gmail.com> - 2012-03-14 20:26 -0700
    Re: onkeydown and onkeyup Gene Wirchenko <genew@ocis.net> - 2012-03-14 22:13 -0700
      Re: onkeydown and onkeyup David Mark <dmark.cinsoft@gmail.com> - 2012-03-14 22:40 -0700
        Re: onkeydown and onkeyup Gene Wirchenko <genew@ocis.net> - 2012-03-15 08:25 -0700
          Re: onkeydown and onkeyup "J.R." <groups_jr-1@yahoo.com.br> - 2012-03-18 13:07 -0300
            Re: onkeydown and onkeyup David Mark <dmark.cinsoft@gmail.com> - 2012-03-19 00:05 -0700
          Re: onkeydown and onkeyup "Mel Smith" <med_cutout_syntel@aol.com> - 2012-03-19 09:54 -0700
            Re: onkeydown and onkeyup Gene Wirchenko <genew@ocis.net> - 2012-03-19 12:37 -0700
              Re: onkeydown and onkeyup "Evertjan." <exjxw.hannivoort@interxnl.net> - 2012-03-19 20:53 +0000
                Re: onkeydown and onkeyup Gene Wirchenko <genew@ocis.net> - 2012-03-19 16:20 -0700
                Re: onkeydown and onkeyup Jeff North <jnorthau@yahoo.com.au> - 2012-03-20 12:12 +1100
                Re: onkeydown and onkeyup Gene Wirchenko <genew@ocis.net> - 2012-03-19 18:45 -0700
                Re: onkeydown and onkeyup Jeff North <jnorthau@yahoo.com.au> - 2012-03-20 17:17 +1100
                Re: onkeydown and onkeyup David Mark <dmark.cinsoft@gmail.com> - 2012-03-20 16:37 -0700
                Re: onkeydown and onkeyup Gene Wirchenko <genew@ocis.net> - 2012-03-20 19:25 -0700
                Re: onkeydown and onkeyup Dr J R Stockton <reply1212@merlyn.demon.co.uk.not.invalid> - 2012-03-21 19:27 +0000
                Re: onkeydown and onkeyup Gene Wirchenko <genew@ocis.net> - 2012-03-21 19:19 -0700
                Re: onkeydown and onkeyup "Evertjan." <exjxw.hannivoort@interxnl.net> - 2012-03-22 16:06 +0000
                Re: onkeydown and onkeyup Gene Wirchenko <genew@ocis.net> - 2012-03-22 09:59 -0700
                Re: onkeydown and onkeyup "Evertjan." <exjxw.hannivoort@interxnl.net> - 2012-03-22 18:10 +0000
                Re: onkeydown and onkeyup Tim Streater <timstreater@greenbee.net> - 2012-03-22 19:19 +0000
                Re: onkeydown and onkeyup Mike Duffy <Use_guestbook_page@website.in.sig> - 2012-03-23 01:44 +0000
                Re: onkeydown and onkeyup Gene Wirchenko <genew@ocis.net> - 2012-03-22 12:36 -0700
                Re: onkeydown and onkeyup "Evertjan." <exjxw.hannivoort@interxnl.net> - 2012-03-23 09:05 +0000
              Re: onkeydown and onkeyup "Mel Smith" <med_cutout_syntel@aol.com> - 2012-03-19 15:49 -0700
      Re: onkeydown and onkeyup Ross McKay <au.org.zeta.at.rosko@invalid.invalid> - 2012-03-16 12:59 +1100
        Re: onkeydown and onkeyup Gene Wirchenko <genew@ocis.net> - 2012-03-15 21:58 -0700
          Re: onkeydown and onkeyup Ross McKay <au.org.zeta.at.rosko@invalid.invalid> - 2012-03-16 18:13 +1100
            Re: onkeydown and onkeyup Gene Wirchenko <genew@ocis.net> - 2012-03-16 08:11 -0700
              Re: onkeydown and onkeyup John G Harris <john@nospam.demon.co.uk> - 2012-03-16 16:58 +0000
                Re: onkeydown and onkeyup Gene Wirchenko <genew@ocis.net> - 2012-03-16 12:05 -0700
        Re: onkeydown and onkeyup Dr J R Stockton <reply1211@merlyn.demon.co.uk.not.invalid> - 2012-03-17 19:13 +0000
          Re: onkeydown and onkeyup Ross McKay <au.org.zeta.at.rosko@invalid.invalid> - 2012-03-18 12:46 +1100
            Re: onkeydown and onkeyup David Mark <dmark.cinsoft@gmail.com> - 2012-03-17 19:13 -0700
            Re: onkeydown and onkeyup Gene Wirchenko <genew@ocis.net> - 2012-03-17 23:27 -0700

csiph-web