www.webdeveloper.com
Results 1 to 4 of 4

Thread: Multiple form fields to clipboard?

  1. #1
    Join Date
    Jun 2010
    Posts
    4

    Exclamation Multiple form fields to clipboard?

    Hey I am trying to figure out how to make multiple form fields send to clipboard. I know How to make on field but not multiple.

    any ideas???? please help

  2. #2
    Join Date
    Jan 2009
    Posts
    3,346
    Have you tried concatenating your variables before sending the value to the clipboard?

  3. #3
    Join Date
    Jun 2010
    Posts
    4
    This is what I have now from previous peoples efforts.
    <head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">





    <script>
    function el(tid) {return document.getElementById(tid);}

    function copyit(){
    var b = [];
    b.push(el("t1").value);
    b.push(el("t2").value);
    b.push(el("t3").value);
    b.push(el("t4").value);
    var buffer = b.join(';');
    CB(buffer);


    document.execCommand("Copy")
    copiedtext=window.clipboardData.getData("Text");
    }

    </script>
    </head>
    <body>
    <input type="text" name="a1" value="" id="t1" />
    <input type="text" name="a2" value="" id="t2" />
    <input type="text" name="a3" value="" id="t3" />
    <input type="text" name="a4" value="" id="t4" />
    <BUTTON onClick="copyit();">Click here to Copy the contents </BUTTON>
    </body>

  4. #4
    Join Date
    Jan 2009
    Posts
    3,346
    This is the Java board not Javascript board. What you have posted is Javascript.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles