#1
  1. No Profile Picture
    Contributing User
    ASP Explorer (0 - 99 posts)

    Join Date
    Jan 2008
    Posts
    88
    Rep Power
    11

    Copy to clipboard ... need help!


    We have a javascript function on a web page (HTML5) that copies the contents of a textarea named LinkCode to the user's clipboard. It works perfectly across all browsers we have tested:

    Code:
    function copyit() {
    	var text_to_copy = document.getElementById("LinkCode");
    	text_to_copy.focus();
    	text_to_copy.setSelectionRange(0, text_to_copy.value.length);
            document.execCommand("copy");
    	alert("The LinkCode has been copied to your clipboard.");
    }
    Now, we are trying to use the same concept to copy the entire contents of an iframe on the same page to the clipboard. The trick seems to be to get the contents of the iframe, just like the code above gets the contents of a textarea. We have not been able to make it work and need help.

    Thanks.
    Last edited by brossyg; November 12th, 2015 at 08:09 PM.

Similar Threads

  1. Copy a file to the clipboard
    By crasy88 in forum Microsoft Access Help
    Replies: 1
    Last Post: July 16th, 2009, 12:05 PM
  2. Copy dataGrid's data to clipBoard
    By gorgenyi in forum .NET Development
    Replies: 1
    Last Post: March 22nd, 2007, 01:07 PM
  3. copy image to clipboard
    By zman in forum ASP Development
    Replies: 4
    Last Post: February 6th, 2006, 03:01 PM
  4. Copy data to clipboard ?
    By dwe in forum HTML, JavaScript And CSS Help
    Replies: 3
    Last Post: February 13th, 2005, 05:25 PM

IMN logo majestic logo threadwatch logo seochat tools logo