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" Newsgroups: comp.lang.javascript Subject: Re: How to set 'onKeyPress ...' programmatically ? Date: Wed, 18 Jan 2012 16:31:07 -0700 Lines: 33 Message-ID: <9np31vFcp6U1@mid.individual.net> References: <9np0guFpjtU1@mid.individual.net> <9np21iF4v2U1@mid.individual.net> X-Trace: individual.net JD7zvMp+g5E7bzyXyh4p4gXQvm0xeIgLJ0+E8olHGiy81lADAs Cancel-Lock: sha1:kDAJEkkkt9KIvpbPskbLj9ScHV4= 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; Response Xref: x330-a1.tempe.blueboxinc.net comp.lang.javascript:10373 "Tim Streater" wrote in message news:timstreater-FEC2D1.23251318012012@news.individual.net... > In article <9np21iF4v2U1@mid.individual.net>, > Well you've not added it yet, have you? > >> // I wish the focusOnElement function to be 'planted' in each of >> my 50+ text fields >> // and I don't what to have to type them in. >> el.onKeyPress = focusOnElement ; // so this craps out :(( > > What do you mean by "craps out"? Hi Tim & Evertjan: Yes, you are (of course) correct ! It occurred to me as I gave up in disgust, then returned a couple of minutes ago, and tried it out with an alert *after* the assignment. now, it returns 'function' as I wanted it to :)) Now,. can I pass an argument to the function (e.g., focusonElement(this) ). Anyway, I'll try it tomorrow and see what happens Thank you both very much ! -Mel Smith