1
   

how do I copy Multiple Form Field data to the Clipboard

 
 
Reply Sat 20 Nov, 2004 01:44 pm
Hi All

I am new to thsi group

Using javascript in IE 5.5 + I need to press a button and copy all the form field data to the clipboard.

I think that the form field data (Multiple fields) must forst be copied to a string, then the string copied to the clipboard??

Can someone please show me how to acheive this?

Thanks in Advance

Ed
  • Topic Stats
  • Top Replies
  • Link to this Topic
Type: Discussion • Score: 1 • Views: 720 • Replies: 3
No top replies

 
Craven de Kere
 
  1  
Reply Sat 20 Nov, 2004 06:43 pm
Re: how do I copy Multiple Form Field data to the Clipboard
EdHannan wrote:
I think that the form field data (Multiple fields) must forst be copied to a string, then the string copied to the clipboard??


Sound about right.

Unfortunately I can't write the script for you at this time.
0 Replies
 
EdHannan
 
  1  
Reply Mon 22 Nov, 2004 04:13 am
String to clipboard
Craven

thanks for your reply and have a good break.

I am still learning javascript and have been able to copy the data from one form field to the clipboard but having a little trouble getting it all in to a string:(

Hope you can point me in the right direction at your convenience

Thanks very much

Ed
0 Replies
 
EdHannan
 
  1  
Reply Mon 22 Nov, 2004 05:13 am
Hre is my function code to copy one element on a form
function clipboard()
{
var oElement = document.getElementById("refnum");//get the refnum ID
oElement.createTextRange().execCommand("Copy");//copy the contents to the windows clipboard
}

This works ok, but mulltiple elements dont work, I have tried assiging different elements to a string then concatenating..but I get errors, here is my code for this.

function clipboard()// multiple elements
{
var tempstore = "";
var therange;
var tempref = document.getElementById("refnum");//get the refnum ID
var tempamount = document.getElementById("amount");
tempstore = tempref + tempamount;// concatenate strings
//tempstore.createTextRange().execCommand("Copy");//copy the contents to the windows clipboard

therange=tempstore.createTextRange();
therange.execCommand("Copy");

Can anyone shed any light on where I am going wrong here

Cheers

Ed
0 Replies
 
 

Related Topics

Webdevelopment and hosting - Question by harisit2005
Showing an Ico File - Discussion by Brandon9000
how to earn money in internet - Discussion by rizwanaraj
The version 10 bug. Worse then Y2K! - Discussion by Nick Ashley
CSS Border style colors - Question by meesa
There is no Wisdom in Crowds - Discussion by ebrown p
THANK YOU CRAVEN AND NICK!!! - Discussion by dagmaraka
I'm the developer - Discussion by Nick Ashley
 
  1. Forums
  2. » how do I copy Multiple Form Field data to the Clipboard
Copyright © 2025 MadLab, LLC :: Terms of Service :: Privacy Policy :: Page generated in 0.03 seconds on 01/17/2025 at 07:48:43