[thelist] javascript question

Sam-I-Am sam at sam-i-am.com
Fri Sep 26 12:03:40 CDT 2003

instead assigning the eventhandler to the document, assign it to 
specific input fields. That way you maintain control over where you want 
to apply this behaviour.

<input type="text" onkeyup="handleKeys()">

no? Like most of us, I've only dabbled with key handling, so I might 
off-track here.


Marek Kilimajer wrote:
> I'm too lazy to search in the docs to make sure but this should be it:
> function SuppressEnter(e)
> {
>     if(event && event.keyCode==13) return false; // for IE
>     if(e && e.keyCode==13) return false;  // for compliant browsers
>     return true;
> }
> mike karthauser wrote:
>> on 26/9/03 2:42 pm, Tom Dell'Aringa at pixelmech at yahoo.com wrote:
>>> So good thing to bring up the point that it breaks certain things for
>>> the user. But we should stop short of pointing fingers. :) Probably
>>> when I submitted my code snippet, I should have mentioned the things
>>> that jeff did - and next time I will.
>> So was there a cross browser answer for locking out the enter key for 
>> your
>> submits? I've been following this strand but seemed to have missed the
>> point..

More information about the thelist mailing list