dcsimg
www.webdeveloper.com
Results 1 to 2 of 2

Thread: Help with simple form, with a textarea

Hybrid View

  1. #1
    Join Date
    Jan 2014
    Posts
    1

    Exclamation Help with simple form, with a textarea

    I was wondering if anyone could help me with this very simple form I have not scripted in a long time and would like some assistance. What I was trying to do was to copy the text from the text area and put it in a div tag further down the page after clicking the submit button. Thank you in advance.

    <form name="myForm" id="myForm" method="get">
    <textarea rows="4" cols="70" id="txt" style="width:85%;wrapff" autofocus placeholder="Please type then click submit" ></textarea>
    <input type="button" value="Submit" onclick="formSubmit()">
    </form>

    <div class="grid-100 prefix-5">
    <script>
    function formSubmit()
    {
    txt=document.getElementById("myForm");
    document.write(txt);
    }
    </script>
    </div>

  2. #2
    Join Date
    Feb 2012
    Posts
    61
    you can do that way.....
    <form name="myForm" id="myForm" method="get">
    <textarea rows="4" cols="70" id="txt" style="width:85%;wrapff" autofocus placeholder="Please type then click submit" ></textarea>
    <input type="button" value="Submit" onclick="formSubmit()">
    </form>

    <div class="grid-100 prefix-5">
    <script>
    function formSubmit()
    {
    var myVarName=document.getElementById("txt").value;
    document.write(myVarName);
    }
    </script>

    Hope that would be helpful to you...

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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



Recent Articles