[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 242
  • Last Modified:

Paste button in HTML?

Is there a piece of simple code that allows a paste button on a web page to paste the contents of the clipboard into a text box on the page. Also while I'm asking, is there a way to have a copy and a cut button too?
If there is I will up the points to 150 for anyone who can direct me to somewhere with the code or provide me with the code.
Thanks
0
wjdashwood
Asked:
wjdashwood
  • 2
1 Solution
 
wjdashwoodAuthor Commented:
No replies as yet, so I have increased the points for the answer and will increase them again to 350 to get the cade.
Thanks
0
 
emmeeCommented:
Hi,

From your question, it looks as if you need something in javascript called document.execCommand("Copy"), document.execCommand("Paste"), document.execCommand("Cut")  They act  like the cut, paste, copy facilities you get in say MS Word, MS Excel.

What you need to do is create a form button in HTML and then create a javascript function which get's called when you click on the button.  Therefore, if you wanted a separate button for cut, copy and paste you would have three small functions with for each facility.  

For more information maybe you could search google for 'document.execCommand in javascript'

I hope this helps as I don't think I've answered your question fully.

Emmee




0
 
wjdashwoodAuthor Commented:
This is apparently IE specific. Is there anything more general? Either javascript or otherwise.
That is what I am looking for though, just would prefer something that could work on all systems.
Thanks
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now