RJ said:
[...] 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. [...]
Just set a html property "onpaste"..
some thing like this: <TEXTAREA name="comments" id="comments" rows="4"
cols="20" onpaste="false"></TEXTAREA>
^^^^^^^^^^^^^^
That's proprietary nonsense.
Now anybody can paste anything in your text area!
You can have that without without invalid markup. Really. Maybe you meant
to say "Now _nobody_ can paste anything in your text area" but that is
equally wrong as this proprietary attribute would need to be supported.
And you completely missed the point of the OP's question. The goal is _not_
to cancel the paste operation, but to *capture* the corresponding event,
i.e. to recognize when it happened and handle it (resize the textarea).
if u wanna do it across javascript: ^
document.getElementsById("comments").onpaste = false
Nonsense. If anything, `onpaste' is the identifier of an event handler
property which expects either `null' or a reference to a callable (usually
Function) object. In order to prevent the default action for the event, one
would have to *return* `false':
document.getElementsById("comments").onpaste = function() {
return false;
};
Sorry my poor english.. Im brazilian!!!
You are also completely clueless; please refrain from giving further advice
until that changed. And as for your English: That's a lame excuse, you are
not even trying to use proper language to begin with. (And I can tell as
English is not my first language.)
That said, this is an *international* newsgroup so you could have written
in Portuguese as well. Not that it would have helped very much as to the
meaning of your posting, though.
Please trim your quotes when you post here next time.
<
http://jibbering.com/faq/#posting>
PointedEars