PDA

View Full Version : display text box input on same page



vhltd
06-26-2007, 03:45 PM
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.

Veronica
06-26-2007, 07:39 PM
Try this:



<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>

jcnaidu
06-27-2007, 04:13 PM
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>