tags:

views:

21

answers:

2

i have made auto grow textarea.it's working fine but when copying and pasting using right click it's not working properly.if i use onchange event in this situation it won't work either because to fire this event we need press enter or tab. please help me to solve this problem

A: 

How about additionally listening to the onpaste event? It's not part of the standard, but works in most major browsers.

Pekka
but this event gets fired just before anything is pasted
Niraj Choubey
@Niraj odd. Are yopu sure? Because that should be done by (IE specific) `onbeforepaste` but not `onpaste`. Can't investigate right now...
Pekka
A: 

You could you a setTimeout to check the character length of the textarea and change it accordingly.. doesn't feel very nice though.

Alternatively you could detect that the right mouse button was clicked using the which or button variables. see here

Andy