469,301 Members | 2,071 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,301 developers. It's quick & easy.

Mozilla / Firefox equivalent to IE onpaste for textareas

Is there anything for Mozilla or Firefox that would be equivalent to
IE's onpaste event for a textarea?

Jul 23 '05 #1
7 26656

Mark Szlazak wrote:
Is there anything for Mozilla or Firefox that would be equivalent to
IE's onpaste event for a textarea?


I should add that using onchange presents a problem since the event
doesn't fire until the textarea looses focus. Whatever solutions that
exist need to work like onpaste without the focus issues of onchange.

Jul 23 '05 #2
DU
Mark Szlazak wrote:
Mark Szlazak wrote:
Is there anything for Mozilla or Firefox that would be equivalent to
IE's onpaste event for a textarea?


There is no equivalent to onpaste event for a textarea, as far as I
understand your post.
"Fires on the target object when the user pastes data, transferring the
data from the system clipboard to the document."
http://msdn.microsoft.com/workshop/a...ts/onpaste.asp
I should add that using onchange presents a problem since the event
doesn't fire until the textarea looses focus. Whatever solutions that
exist need to work like onpaste without the focus issues of onchange.


Maybe if you could provide an url showing how your script works for
MSIE, I could have a look at it and maybe propose an alternative.

DU
--
The site said to use Internet Explorer 5 or better... so I switched to
Mozilla 1.7.6 :)
Jul 23 '05 #3
DU wrote:
Maybe if you could provide an url showing how your script works for
MSIE, I could have a look at it and maybe propose an alternative.

DU


Thanks for the offer DU but I do have alternatives. However, I need to
seriously consider this particular option if a viable one exists.

Jul 23 '05 #4


Mark Szlazak wrote:
Is there anything for Mozilla or Firefox that would be equivalent to
IE's onpaste event for a textarea?


You could try to use
<textarea oninput="..."
with Mozilla, of course it doesn't fire only for text being pasted but
also for other text manipulation like cutting text but at I think it is
the only event handler in Mozilla and HTML documents being fired when
text is pasted into a text control.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #5

Martin Honnen wrote:
Mark Szlazak wrote:
Is there anything for Mozilla or Firefox that would be equivalent to IE's onpaste event for a textarea?
You could try to use
<textarea oninput="..."
with Mozilla, of course it doesn't fire only for text being pasted

but also for other text manipulation like cutting text but at I think it is the only event handler in Mozilla and HTML documents being fired when text is pasted into a text control.

--

Martin Honnen
http://JavaScript.FAQTs.com/


That will work just fine. Thanks.

Jul 23 '05 #6
Martin Honnen wrote:
Mark Szlazak wrote:
Is there anything for Mozilla or Firefox that would be equivalent to
IE's onpaste event for a textarea?


You could try to use
<textarea oninput="..."
with Mozilla, of course it doesn't fire only for text being pasted but
also for other text manipulation like cutting text but at I think it is
the only event handler in Mozilla and HTML documents being fired when
text is pasted into a text control.


frm.ctlName.addEventListener("DOMCharacterDataModi fied",
function(e){myEventHandler(e);}, false);

This method works, but it has several minor bugs which I logged at:
https://bugzilla.mozilla.org/show_bug.cgi?id=285272

Also, note that if you do something like select the 5 in 54321
and then press 6 (changing the text to 64321) you will fire twice:
The first time the value will be 4321,
and the second firing will have 64321

Csaba Gabor from Vienna
Jul 23 '05 #7
ok

----------------------------------------------
Posted with NewsLeecher v2.0 Beta 5
* Binary Usenet Leeching Made Easy
* http://www.newsleecher.com/?usenet
----------------------------------------------
Apr 19 '07 #8

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by AP | last post: by
6 posts views Thread by Red_Indian | last post: by
9 posts views Thread by Paul Gorodyansky | last post: by
10 posts views Thread by News | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by Geralt96 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.