Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Jan 2005
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Getting text copied other fields?

    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>

  • #2
    Senior Coder
    Join Date
    Nov 2003
    Location
    Minneapolis, MN
    Posts
    2,879
    Thanks
    2
    Thanked 65 Times in 56 Posts
    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.

  • #3
    Super Moderator sage45's Avatar
    Join Date
    May 2002
    Posts
    1,064
    Thanks
    0
    Thanked 15 Times in 15 Posts
    Moving post per uiowahawk's request...

    -sage-
    HTML & CSS Forum Moderator

    "If you don't know what you think you know, then what do you know."
    R.I.P. Derrick Thomas #58
    1/1/1967 - 2/8/2000

  • #4
    teh Moderatorinator
    Join Date
    Sep 2004
    Location
    USA
    Posts
    2,472
    Thanks
    4
    Thanked 40 Times in 40 Posts
    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?

  • #5
    New to the CF scene
    Join Date
    Jan 2005
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.


  •  

    Posting Permissions

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