PDA

View Full Version : Getting text copied other fields?


uiowahawk
01-07-2005, 09:59 PM
Right now, I'm working on a form that has multiple spaces for your name/date.

The problem I'm running up against is that i can only get the text to copy in one space. Does anyone know how to make it work for multiple entries?

Here's what I have right now...

<html>

<head>
<script language="JavaScript"><!--
function copyData(from,to) { to.value = from.value; }
//--></script>
</head>
<body>

<form name="myForm">
<center><h3>RN/LPN Job Application</h3></center>
Today's Date:<input type="text" name="date"
onChange="copyData(this,document.myForm.date2)"
onKeyUp="copyData(this,document.myForm.date2)">
Date Available for Work:<input type="text" name="datework">

<p>Full Legal Name:<input type="text" name="name" size="25"
onChange="copyData(this,document.myForm.name2)"
onKeyUp="copyData(this,document.myForm.name2)">
Email Address:<input type="text" name="email" size="30">

<p>Date:<input type="text" name="date2"
onChange="copyData(this,document.myForm.date)"
onKeyUp="copyData(this,document.myForm.date)">
<p>Applicant Printed Name:<input type="text" name="name2" size="25"
onChange="copyData(this,document.myForm.name)"
onKeyUp="copyData(this,document.myForm.name)">
</form>

<p>Date:<input type="text" name="date3">
<p>Applicant Printed Name:<input type="text" name="name3">

</body>
</html>

rmedek
01-07-2005, 10:07 PM
I'm pretty sure, considering the javascript, that this is a javascript question, not an html/css one.

DON'T CROSSPOST... just ask a moderator to move it for you, and I'm sure someone there would be glad to help.

sage45
01-10-2005, 05:39 PM
Moving post per uiowahawk's request...

-sage-

Brandoe85
01-10-2005, 11:06 PM
Whats the problem? it seems to be copying the text from one text box to the other, and it's doing it to each one you've called the function on...if you wanted to do it to all of them just call the function again as you were doing for the other text boxes....I guess I don't understand the question...could you explain in more detail? :)

uiowahawk
01-11-2005, 01:17 AM
This topic can actually be closed. We decided not to do what we were going to do.

The idea was to have a bunch of forms and about 9 spaces for a person's name. The I wanted was to be able to enter the name once and the other 8 spaces on the document to fill in also.