Connecting Tech Pros Worldwide Help | Site Map

Mozilla / Firefox equivalent to IE onpaste for textareas

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 23rd, 2005, 06:23 PM
Mark Szlazak
Guest
 
Posts: n/a
Default 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?


  #2  
Old July 23rd, 2005, 06:23 PM
Mark Szlazak
Guest
 
Posts: n/a
Default Re: Mozilla / Firefox equivalent to IE onpaste for textareas


Mark Szlazak wrote:[color=blue]
> Is there anything for Mozilla or Firefox that would be equivalent to
> IE's onpaste event for a textarea?[/color]

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.

  #3  
Old July 23rd, 2005, 06:24 PM
DU
Guest
 
Posts: n/a
Default Re: Mozilla / Firefox equivalent to IE onpaste for textareas

Mark Szlazak wrote:
[color=blue]
> Mark Szlazak wrote:
>[color=green]
>>Is there anything for Mozilla or Firefox that would be equivalent to
>>IE's onpaste event for a textarea?[/color]
>
>[/color]

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
[color=blue]
> 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.
>[/color]

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 :)
  #4  
Old July 23rd, 2005, 06:24 PM
Mark Szlazak
Guest
 
Posts: n/a
Default Re: Mozilla / Firefox equivalent to IE onpaste for textareas

DU wrote:[color=blue]
> 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[/color]

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

  #5  
Old July 23rd, 2005, 06:24 PM
Martin Honnen
Guest
 
Posts: n/a
Default Re: Mozilla / Firefox equivalent to IE onpaste for textareas



Mark Szlazak wrote:
[color=blue]
> Is there anything for Mozilla or Firefox that would be equivalent to
> IE's onpaste event for a textarea?[/color]

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/
  #6  
Old July 23rd, 2005, 06:24 PM
Mark Szlazak
Guest
 
Posts: n/a
Default Re: Mozilla / Firefox equivalent to IE onpaste for textareas


Martin Honnen wrote:[color=blue]
> Mark Szlazak wrote:
>[color=green]
> > Is there anything for Mozilla or Firefox that would be equivalent[/color][/color]
to[color=blue][color=green]
> > IE's onpaste event for a textarea?[/color]
>
> You could try to use
> <textarea oninput="..."
> with Mozilla, of course it doesn't fire only for text being pasted[/color]
but[color=blue]
> also for other text manipulation like cutting text but at I think it[/color]
is[color=blue]
> the only event handler in Mozilla and HTML documents being fired when[/color]
[color=blue]
> text is pasted into a text control.
>
> --
>
> Martin Honnen
> http://JavaScript.FAQTs.com/[/color]

That will work just fine. Thanks.

  #7  
Old July 23rd, 2005, 06:26 PM
Csaba Gabor
Guest
 
Posts: n/a
Default Re: Mozilla / Firefox equivalent to IE onpaste for textareas

Martin Honnen wrote:[color=blue]
> Mark Szlazak wrote:[color=green]
>> Is there anything for Mozilla or Firefox that would be equivalent to
>> IE's onpaste event for a textarea?[/color]
>
> 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.[/color]

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
  #8  
Old April 19th, 2007, 12:25 AM
Adil
Guest
 
Posts: n/a
Default Re: Mozilla / Firefox equivalent to IE onpaste for textareas

ok

----------------------------------------------
Posted with NewsLeecher v2.0 Beta 5
* Binary Usenet Leeching Made Easy
* http://www.newsleecher.com/?usenet
----------------------------------------------


 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,662 network members.