File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can We Invoke Keyboard Events On Button Press ?

 
Gajendra Tomer
Ranch Hand
Posts: 32
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All !

We have a requirement to copy text from TextArea1 & paste it into TextArea2 with the help of 2 push buttons: "Copy" & "Paste", instead of using "CTRL+C" & "CTRL+V" key combinations.

We have done it in IE 7 & 8 but we are not able to make it done in Mozilla Firefox 3.6 browser.

Please help in this regard.

Thanks in advance.

Gajendra Singh Tomar

 
Tom Varga
Greenhorn
Posts: 8
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Because of security restrictions, clipboard access is not always allowed in Firefox (see clipboardData)

A possible solution is to store the selected text in a JavaScript variable on copy and insert its value on paste. The disadvantage of that solution is that the user cannot use CTRL+V to paste the text into TextArea2, because it is not on the clipboard.



Related links:
selectionStart property,
value property (textarea).
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic