Re: Detecting which context menu item was selected



Ultimately, I'm trying to keep a running total of how many characters
are in the TEXTAREA. So really, however text can be entered, whether
it's keyed or pasted (context menu, control+v), I want to be able to
get the total.
Randy Webb wrote:
brisco5@xxxxxxxxx said the following on 6/29/2006 4:54 PM:
I have a TEXTAREA element. A user right clicks within in to get the
context menu and they select "paste".

OK, but that is not the only way to "paste". There are at least 3 other
ways.

I want my javascript code to know that they selected "paste".

Do you want to know they selected "paste" from that menu or that they
pasted text into your textarea? The difference in the two is astronomical.

I know you can capture the mouse click, but can we capture exactly what
event that attempted?

Doubtful, depending on what you are really trying to do.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Temporarily at: http://members.aol.com/_ht_a/hikksnotathome/cljfaq/
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/

.



Relevant Pages

  • Re: setSelectionRange and friends
    ... textarea that I think might be useful in this context (found by some ... amount of googling). ...
    (comp.lang.javascript)
  • Re: Detecting which context menu item was selected
    ... context menu and they select "paste". ... pasted text into your textarea? ... Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/ ...
    (comp.lang.javascript)
  • Re: [PHP] array_search
    ... My new page has a textarea field. ... do with textareas or line breaks except in the context you're using it in... ...
    (php.general)
  • Re: Display multiple lines
    ... The data is collected in a ASP form "textarea" ... The data is then displayed in an HTML form. ... or line feed characters in the text, ... Data display process: ...
    (microsoft.public.inetserver.asp.general)
  • Re: Schema: error with restriction in simpleContent
    ... and want to restrict "foo" to the length of 10 characters, ... Well, restrict then extend. ... Element 'textarea': The attribute 'label' is required but ... sch1.xml fails to validate ...
    (comp.text.xml)