Results 1 to 3 of 3

Thread: display text box input on same page

  1. #1
    Join Date
    Jun 2007
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default display text box input on same page

    I have a page which requests some input from the user, into a text box. Further down the page I want to display the text typed into the text box.

    Can anyone help me achieve this ? Thanks.

  2. #2
    Join Date
    Feb 2007
    Posts
    293
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Try this:

    Code:
    <html>
    <head>
    </head>
    <body>
    <script type="text/javascript">
    function changeThis(){
    	var formInput = document.getElementById('theInput').value;
    	document.getElementById('newText').innerHTML = formInput;
    }
    </script>
    <p>You wrote: <span id='newText'></span> </p> 
    
    <input type='text' id='theInput' value='Write here' />
    <input type='button' onclick='changeThis()' value='See what you wrote'/>
    </body>
    </html>

  3. #3
    Join Date
    Jun 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by vhltd View Post
    I have a page which requests some input from the user, into a text box. Further down the page I want to display the text typed into the text box.

    Can anyone help me achieve this ? Thanks.
    Try this example but dont forget to save this as .asp extension



    <html>
    <body>
    <form action="demo_reqquery.asp" method="get">
    Your name: <input type="text" name="fname" size="20" />
    <input type="submit" value="Submit" />
    </form>
    <&#37;
    dim fname
    fname=Request.QueryString("fname")
    If fname<>"" Then
    Response.Write("Hello " & fname & "!<br />")
    Response.Write("How are you today?")
    End If
    %>
    </body>
    </html>

Bookmarks

Posting Permissions

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