Re: capture 'Paste' event in text-area



On Dec 5, 4:11 am, Erwin Moller
<Since_humans_read_this_I_am_spammed_too_m...@xxxxxxxxxxxxxxxx> wrote:
RJ schreef:

The scenario is.... there is a text-area that is used as chatbox where
user enters their text msgs for chatting ..now it has a fixed width
but the height increases according to the content.... now the problem
that i am facing is whenver i do a cntrl+v on to the textarea , the
height of the textarea does not increase according to the contents.
I tried capturing the cntrl key event using "event.ctrlKey" on
"onkeypress" event, but i works only for FF and fails in IE and
chrome.

Is there any way by which i can capture 'Paste' event......

Any help wld be highly appreciated.

Thanks,
RJ

Hi,

Have a look here:http://www.quirksmode.org/dom/w3c_events.html#keyprops

Please note the listed keydown and keyup. keypress is NOT listed.


That site should not be treated as reference material. I consider it
harmful as the descriptions of the "quirks" are often confused (among
other things.)

And I don't see the problem with the keypress event in general
(whether it is listed on PPK's page or not.) Certainly none of the
key* events will help with a keyboard accelerator like Ctrl+V, which
is eaten by the browser.

I believe IE has a proprietary paste event. Agents without such
extensions will have to make do with keyup and change (keypress is
clearly wrong in this context.)

[snip]
.



Relevant Pages