473,404 Members | 2,195 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,404 software developers and data experts.

Detecting past into textarea

Does anyone know how to detect if a user has pasted code using the
right mouse button into a textarea?

I have fields in a form that autoupdate when text is changed in a
textarea, but if it is pasted using the mouse (not CTRL-V) the trigger
doesn't happen.

I tried onChange first, no luck. Detecting keystrokes and LEFT
mouseclicks was easy enough, and it works for those. But SOME users
paste stuff in without ever typing or left-clicking and it is messing
everything up.

Thanks,
Holden
PS: I think I may have to go into the murky world of right-click
detection (sorting through dozens of crappy reputed "source code
protectors") unless someone can give me a lead (or even better the
needed event handler!)
PPS: To make matters worse, it needs to work with IE 5 and up.
(Intranet)

Thanks,
Holden
Jul 20 '05 #1
3 5142
"Holden Caulfield" <co***********@hotmail.com> wrote in message
news:6d**************************@posting.google.c om...
<snip>
... . But SOME users paste stuff in without ever
typing or left-clicking and it is messing <snip> PPS: To make matters worse, it needs to work
with IE 5 and up. (Intranet)


That doesn't make it worse it makes it easier as IE 5 textarea elements
support:-

onbeforepaste
onpaste

- which should suite you task.

(but doesn't IE allow you to drag and drop text into a textarea? I don't
recall whether that counts as a paste.)

Richard.
Jul 20 '05 #2

"Richard Cornford" <Ri*****@litotes.demon.co.uk> wrote in message
news:bu*******************@news.demon.co.uk...
"Holden Caulfield" <co***********@hotmail.com> wrote in message
news:6d**************************@posting.google.c om...
<snip>
... . But SOME users paste stuff in without ever
typing or left-clicking and it is messing

<snip>
PPS: To make matters worse, it needs to work
with IE 5 and up. (Intranet)


That doesn't make it worse it makes it easier as IE 5 textarea elements
support:-

onbeforepaste
onpaste

- which should suite you task.

(but doesn't IE allow you to drag and drop text into a textarea? I don't
recall whether that counts as a paste.)


ondrop fires.

Jul 20 '05 #3
Thanks Richard and Richard,
I will give those a try.

Much appreciated,

Holden
Jul 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Doug van Vianen | last post by:
Hi, I am working on an Applet which provides some mouse practice for new computer users in our local seniors' computer club. The applet contains several cards, in a card layout, which are...
3
by: Lorenzo Bolognini | last post by:
Hi all, i'd like to know if there is some way to detect whether a field is of type MEMO (i'm using MS Access) so to behave accordingly placing a textarea instead of a textbox in the UI. Thank...
4
by: Csaba Gabor | last post by:
What I'd like to do is to be able to set the font of a textarea element to the same font that another element is using (say, for example, an <INPUT type=text ...> element, but if that's a no go,...
1
by: Volt | last post by:
is there any way to select and mark part of text in textarea by regular expression? i need to select the first string in textarea whitch is like xxxxx,xxx where x is any character
25
by: Ryan Stewart | last post by:
I'm working on a project to collect web application usage statistics. What are the recommended ways of detecting whether a browser is JavaScript enabled and/or capable? Obviously I can write a...
1
by: laredotornado | last post by:
Hello, I am trying to detect whether a user entered text in a textarea or hit the delete/backspace button (thus, erasing something). Once that is detected, I would like to set "var bSaveRequired =...
1
by: Mark Szlazak | last post by:
Is there a way to detect if an textarea onscroll event is working in Firefox (or Mozilla). I know that there is an onscroll event bubbling bug with current vesions of these browsers so I want to...
4
by: TJS | last post by:
can the rows and columns of a textarea element with an id be changed on the fly ? if so is there an example ?
3
by: brisco5 | last post by:
I have a TEXTAREA element. A user right clicks within in to get the context menu and they select "paste". I want my javascript code to know that they selected "paste". I know you can capture the...
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.