Click here to Skip to main content
15,885,890 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have a dynamically created editor using iframe in my application having cut copy and paste options. All options are working fine except the paste. I am using the following code for paste

eval('frame1').document.execCommand('paste');

Please help me in this.

Thanks,
Posted
Comments
Sergey Alexandrovich Kryukov 4-Mar-13 11:22am    
It does not work in all browsers... Why using it? It assumes the user has something in Clipboard. Why?
—SA

1 solution

Assuming there is a textbox inside that iframe, something like this should work:

JavaScript
eval('frame1').document.Form1.txtArea.focus();
PastedText = eval('frame1').document.Form1.txtArea.createTextRange();
PastedText.execCommand("Paste");
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900