Write text box input from one form to a hiiden field in another

Discussion in 'JavaScript' started by cmc@savycat.com, Jan 30, 2007.

  1. #1
    How do I write a text box input from one form to a hidden field in another form?

    <form name='form1' action='' method='post'>
    <input type='text' name='text1' value=''>
    </form>

    <form name='form2' action='' method='post'>
    <input type='hidden' name='hidden1' value='form1.text1'>
    </form>
     
    cmc@savycat.com, Jan 30, 2007 IP
  2. rays

    rays Active Member

    Messages:
    563
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    58
    #2
    try this code ...


    <form name='form1' action='' method='post'>
    <input type='text' name='text1' value='' onkeyup="document.getElementById('hidden1').value = this.value " >
    </form>

    <form name='form2' action='' method='post'>
    <input type='hidden' id ="hidden1'" name='hidden1' value='form1.text1'>
    </form>
    Reply With Quote
     
    rays, Jan 30, 2007 IP