2

Is it possible create a button that can be used to paste some clipboard text into a textbox using javascript? In my project I'm using ZeroClipboard to copy any text that I want, but now I need to paste that information using a single button in other page without any copy page connection. At the internet I found ways to do that, but it just works on IE and I need a cross browser solution (minimun IE, chrome and FF). Can anyone help me?

Other info: I'm using asp.net mvc 3

Fernando Juarez
  • 87
  • 2
  • 10

2 Answers2

1

For security reasons, Javascript don't have access to clipboard. ZeroClipboard uses Flash in order to copy the text to clipboard BUT for security reasons too, Flash can only write to clipboard, not read.

The only way to do it is using a Java applet.

Ravan Scafi
  • 6,382
  • 2
  • 24
  • 32
-1

Here is article/Tutorial explaining how to do it : http://www.dynamic-tools.net/toolbox/copyToClipboard/

But the best pratice is to have a textarea with the data to copy already selected. Because some browser will not let you change the value of the clipboard data.

David Laberge
  • 15,435
  • 14
  • 53
  • 83