473,394 Members | 1,201 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

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 26950

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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: AP | last post by:
LS, Is their a way of using then command 'onPaste' and 'onDragLeave' or an alternative in PHP. Needed to paste a selected text in a textarea and after paste executing a PHP script without to...
3
by: John Reese | last post by:
Mozilla, Firefox, Thunderbird, and so forth use this awful format called MORK to store all kinds of things: which messages you've read in a newsgroup, headers and indexes into the mbox file of...
6
by: Red_Indian | last post by:
Hi How do I accomplish the following functionality in Mozilla/ Firefox: document.form.textbox.disabled = false if I want to conditionally enable a text box that was disabled by default. ...
49
by: Aidan | last post by:
I rely heavily on MSDN for documentation when it comes to HTML/DHTML/JavaScript/CSS but as a result I often have problems getting my stuff to work in Netscape/Mozilla/Firefox. I like the MSDN...
9
by: Paul Gorodyansky | last post by:
Hi, FAQ tells how to insert (or replace0 a text at a caret position in Mozilla (and same works for Opera 8+), for example, at http://www.faqts.com/knowledge_base/view.phtml/aid/1661 it talks...
10
by: News | last post by:
I have a page up trying to learn how to ID a browser and other info. http://wyght.com/warren/testPos.html here is the code <script type = "text/javascript"> var space = ", "; var name...
1
by: rjdougan | last post by:
I am not a developer but need some help with scripts for a client. I have a script to handle form validation and one that handle mouseover on menu. The form validation script works fine by it...
3
by: svsenthilkumar | last post by:
hai , i got an error in javascript, when upload a file in a form, the code is working properly in IE but i got javascript error in Mozilla firefos what is mean by error and how to rectify...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.