Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #10375
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!news.musoftware.de!wum.musoftware.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail |
|---|---|
| From | "Mel Smith" <med_cutout_syntel@aol.com> |
| Newsgroups | comp.lang.javascript |
| Subject | Re: How to set 'onKeyPress ...' programmatically ? |
| Date | Wed, 18 Jan 2012 16:53:47 -0700 |
| Lines | 36 |
| Message-ID | <9np4ceFlgeU1@mid.individual.net> (permalink) |
| References | <9np0guFpjtU1@mid.individual.net> <Xns9FDEF353B131Deejj99@194.109.133.133> <9np21iF4v2U1@mid.individual.net> <Xns9FDF6BFAC416eejj99@194.109.133.133> |
| X-Trace | individual.net eybgXM1vA18lr11C9GWfdAH25hu8dOXS6rEM0Y3/qPm0NIkk0S |
| Cancel-Lock | sha1:vIvPPMgFjNSoafIGrbMncxXW5EA= |
| X-Priority | 3 |
| X-MSMail-Priority | Normal |
| X-Newsreader | Microsoft Outlook Express 6.00.2900.5931 |
| X-MimeOLE | Produced By Microsoft MimeOLE V6.00.2900.6157 |
| X-RFC2646 | Format=Flowed; Original |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.javascript:10375 |
Show key headers only | View raw
"Evertjan." <exjxw.hannivoort@interxnl.net> wrote in message
news:Xns9FDF6BFAC416eejj99@194.109.133.133...
> If something does not work, don't start with such complex code,
> try the most simple one, and then go debugging
>
> It turns out that the onkeypress should be all lowercase:
>
> Tested in Chrome:
> ============================
> <input id=a><br>
> <input id=b><br>
> <input id=c><br>
>
> <script type='text/javascript'>
> var inputs = document.getElementsByTagName('input');
> for (i=0;i<inputs.length;i++)
> inputs[i].onkeypress = f;
>
> function f() {
> alert(this.id);
> };
> </script>
> ============================
Hi Evertjan:
Thanks for the code
Will try again tomorrow -- I have a granddaughter who has to be taken to
the airport in a few minutes.
-Mel
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll 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