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


Groups > comp.lang.javascript > #10377

Re: How to set 'onKeyPress ...' programmatically ?

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!.POSTED!not-for-mail
From "J.R." <groups_jr-1@yahoo.com.br>
Newsgroups comp.lang.javascript
Subject Re: How to set 'onKeyPress ...' programmatically ?
Date Wed, 18 Jan 2012 23:26:26 -0200
Organization Aioe.org NNTP Server
Lines 28
Message-ID <jf7rfs$eit$1@speranza.aioe.org> (permalink)
References <9np0guFpjtU1@mid.individual.net>
NNTP-Posting-Host edb3lPNLwDIT/BKKc/Xuzw.user.speranza.aioe.org
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding 7bit
X-Complaints-To abuse@aioe.org
User-Agent Mozilla/5.0 (Windows NT 6.0; rv:8.0) Gecko/20111105 Thunderbird/8.0
X-Antivirus-Status Clean
X-Notice Filtered by postfilter v. 0.8.2
X-Antivirus avast! (VPS 120118-1, 01/18/2012), Outbound message
Xref x330-a1.tempe.blueboxinc.net comp.lang.javascript:10377

Show key headers only | View raw


On 18/01/2012 20:47, Mel Smith wrote:
> Hi:
>
> Enviro:>50 input text fields
>
> Question:  How does one set _programmatically_ in javascript, the onKeyPress
> event listener ??
>
> I tried a couple of statements (something like el.onKeyPress = myfunction()
> ;  and "myfunction", etc, etc.
>
> Everything craps out and I don't know Where in my JavaScript Bible to look
> for the answer ??
>
> A Hint please ??
>
> Thank you
>

Hi,
You might use:
   el.onkeypress = myfunction; // neither onKeyPress nor myfunction()

Take a look at MSDN to see more details:
<http://msdn.microsoft.com/en-us/library/ms536939(v=vs.85).aspx>

-- 
Joao Rodrigues (J.R.)

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


Thread

How to set 'onKeyPress ...' programmatically ? "Mel Smith" <med_cutout_syntel@aol.com> - 2012-01-18 15:47 -0700
  Re: How to set 'onKeyPress ...' programmatically ? "Evertjan." <exjxw.hannivoort@interxnl.net> - 2012-01-18 22:55 +0000
    Re: How to set 'onKeyPress ...' programmatically ? "Mel Smith" <med_cutout_syntel@aol.com> - 2012-01-18 16:13 -0700
      Re: How to set 'onKeyPress ...' programmatically ? Tim Streater <timstreater@greenbee.net> - 2012-01-18 23:25 +0000
        Re: How to set 'onKeyPress ...' programmatically ? "Mel Smith" <med_cutout_syntel@aol.com> - 2012-01-18 16:31 -0700
      Re: How to set 'onKeyPress ...' programmatically ? "Evertjan." <exjxw.hannivoort@interxnl.net> - 2012-01-18 23:39 +0000
        Re: How to set 'onKeyPress ...' programmatically ? "Mel Smith" <med_cutout_syntel@aol.com> - 2012-01-18 16:53 -0700
  Re: How to set 'onKeyPress ...' programmatically ? "J.R." <groups_jr-1@yahoo.com.br> - 2012-01-18 23:26 -0200
  Re: How to set 'onKeyPress ...' programmatically ? Dr J R Stockton <reply1203@merlyn.demon.co.uk> - 2012-01-19 23:42 +0000
    Re: How to set 'onKeyPress ...' programmatically ? "Mel Smith" <med_cutout_syntel@aol.com> - 2012-01-19 17:07 -0700

csiph-web