Hey Dean, Try this:
http://www.severnsolutions.co.uk/twblog/archive/2003/09/14/keypressevents Mark >From: Dean Fiala <[EMAIL PROTECTED]> >Reply-To: [email protected] >To: [email protected] >Subject: [AspNetAnyQuestionIsOk] Key Capture in Mozilla >Date: Fri, 15 Apr 2005 10:51:22 -0400 > > >OK, >I'm trying to capture a return key being pressed in a text box. > >I capture the event successfully >onKeyPress="javascript:TrapKey(); > >and it calls this function... >function TrapKey(e) >{ > alert('Key Trap Entered'); > if(e.keyCode == 13) > { > e.keyCode == 0; > //do some stuff... > } >} > >this works perfectly in IE > >but in Mozilla the function gets called, but e is always undefined >and hence I cannot read the key code. > >I've done some googling and come up with some variations > >that try and set e, if it is not defined, but none of these work either, >such as > >if (!e) var e = window.event; > >Any thoughts or hints would be appreciated. > >Thanks > > >-- >Dean Fiala >Very Practical Software, Inc >http://www.vpsw.com > > > >Yahoo! Groups Links > > > > > > > Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
