Thanks. That worked :) I should get into the habit of using this 'is()' function. very convenient.
On 23 oct, 18:07, "Richard D. Worth" <[EMAIL PROTECTED]> wrote: > You can check the target of the keypress, by e.target. Something like this > (untested): > > $("#body").keypress(function(e) { > if (e.which == 13 && !$(e.target).is("textarea")) { > return false; > } > > }); > > - Richard > > On Thu, Oct 23, 2008 at 12:37 PM, [EMAIL PROTECTED] < > > [EMAIL PROTECTED]> wrote: > > > Hi, > > > I'm not completely sure this is a jQuery issue or a javascript issue. > > Pardon me if I'm not in the right place. > > > I have disabled the Enter key on the page like that : > > > $("#body").keypress(function(e) { > > if (e.which == 13) { > > return false; > > } > > }); > > > Now the issue I'm facing is that if the user is typing in a textarea > > control, she can't type the Enter key anymore to do a new line ! > > Does anyone know how i can get around that ? > > > Thanks