views:

28

answers:

1

I am able to do that in IE, but FF doesn't allow to do something like:

$("#txtBox").bind('paste', function (e) {
        alert('pasting text!!!!');           
        alert(window.clipboardData.getData("Text"));
        window.event.returnValue = false;


    });

I am required to trap the clipboard contents onpaste, then populate a table with this content. We are allowing people to copy and paste from Excel.

What are some of the ways that are being used to achieve this in FF? Thanks

+4  A: 

For the security reasons, you can't manipulate clipboard contents from JavaScript in Firefox.

If reading and writing clipboard contents is mandatory for your application, you may want to use Silverlight or Flash instead, or another RIA solutions (don't know if other solutions allow to manipulate clipboard).

MainMa
Flash does clipboards too fwiw.
Peter Ajtai
@Peter Ajtai: thanks. Answer modified to include Flash.
MainMa