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 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Dec 2007
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How can i get the value from this form?

    hello

    i have a form which dynamically create another part of the form according to user requirement. but im facing problem to get the form field values. please help me to do it. my form is given below:

    <html>

    <head>

    <title>title</title>

    <meta content="">

    <style></style>



    <script language="javascript">





    var counter = 0; // counter for naming the elements



    function moreFields()

    {

    counter++;

    var newFields = document.getElementById('readroot').cloneNode(true);

    newFields.id = '';

    newFields.style.display = 'block';

    var newField = newFields.childNodes;

    for (var i=0;i<newField.length;i++)

    {

    var theName = newField[i].name

    if(theName)

    {

    newField[i].name = theName + counter;

    newField[i].id = theName + counter;

    }

    }

    var insertHere = document.getElementById('writeroot');

    insertHere.parentNode.insertBefore(newFields,insertHere);

    }



    // -->

    </script>



    </head>

    <body onload="moreFields()">



    <div id="readroot" style="display: none">
    <div align="center">Job Experience <br>
    Company:
    <input type="text" name="company" size="70">
    <br>
    Post :
    <input type="text" name="post" size="70">
    <br>
    Job Duties:
    <textarea name="duties" cols="60" rows="10"></textarea>
    <input type="button" value="Remove" style="font-size: 10px" onClick="this.parentNode.parentNode.removeChild(this.parentNode);">
    </div>
    </div>



    <form method=post>



    <span id="writeroot"></span>

    <p class="hr">&nbsp;</p>



    <input type="button" value="Add New Line" onClick="moreFields()"><br>

    <input type="submit" value="Send form">



    </form>





    </body>

    </html>

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,849
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    How to get value from this form? Your previous post may help!
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)


  •  

    Posting Permissions

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