...

View Full Version : text in one area copied to another window



ventura
07-25-2002, 09:22 PM
Hello All,

I am trying to use JavaScript (I have no way to use server-side scripts)
to collect data from a simple HTML form and post it into another form's
textarea.

The form is basic (3 textboxes and 15 checkboxes)
I wish to use a JavaScript to do one of 2 things:

1. Get the data (like email generation) and insert it into another
form's textarea (one giant textarea in which the data can be reviewed,
and used)
or
2. Get the data and create a new window containing a textarea filled
with the results.

The only reason I need to have the data inserted into a textarea is that
I have prepared another script to allow users to copy and paste this
data into work tickets for PC Support. This is an attempt to simplify
work by creating a yes/no type flowchart which telephone reps can fill
out (follow) to solve and document each conversation they have via
telephone tech support. This script will be called via onClick from a
button.

I realize how much easier this would be via ASP but I have no such
reasources available. In case I have confused anyone, here is a basic
rundown.

Form1 (full of data) -->SUBMIT1 (moves data)-->Form2 (one textarea
containing Form1 results) -->SUBMIT2 (copies all of textarea to
clipboard)

BrightNail
07-26-2002, 12:16 AM
its a simple matter...

textarea 1.where someone types:

textarea 2. where the same info from textarea 1 goes..

document.formname.textareaname2.value=document.formname.textareaname3.value

you didn't say whether or not you wanted all the foms elements in the text box.....if you do...

on your "onClick" button run thru a fucntion that does something simple..like

function name(){
//for the 15 checkboxes assuming you name them
//generic ..like cb0,cb1,cb2,cb3 etc...
for(i=0;i<15;i++){
var cbname=cb;
var val+i=document.formname[cb+i].value + \n;
document.formname.textareaname2.value=val+i;
}
}

or soemthing like that......let me know how it goes



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum