General discussion

Locked

Outputting form values into another html

By kat97 ·
Hi,
I'm quite new to all these please guide me along thanks!

Lets say i created a form in a html.
The form contains 2 text fields for user to enter their first and last name. It also contains a submit button.

<form name="form1" action="action.html" method="post">
<div align="center"></div>
<table border="1" cellspacing="1" cellpadding="1" align="center">
<tr>
<td>
<p>First Name:
<input type="text" name="first" value="">
</p>
<p> Last Name:
<input type="text" name="last" value="">
</p>
</td>
</tr>
<tr>
<td>
<div align="center">
<input type="reset" name="Reset" value="Reset">
<input type="submit" name="Submit" value="Submit">
</div>
</td>
</tr>
</table>
</form>

When the user click the submit button, how do i output the user first and last name which they have entered into action.html.
Saying something like your first name is *****
Your last name is *****

What should the code in action.html be like?

This conversation is currently closed to new comments.

5 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

by Tony Hopkinson In reply to Outputting form values in ...

Look up Clientside only forms. However in this case the page that requested the data would also be the page that displayed the data. ie you'd put an onclick handler in for the button, read the text boxes, hide them and display what was entered, not too useful.
What you really want is a serverside tech ASP, JSP or even PHP or perl or ISAPI or CGI (lots of choices), they would process what was posted from the form which includes the content of the text boxes and build a html page and return it to the browser.
Pick the server side flavour you want, doing this sort of thing is one of the first things you learn to do with it. The exact syntax depends on which one you choose.

Collapse -

by kat97 In reply to
Collapse -

by ebuild In reply to Outputting form values in ...

using jsp : action.jsp
your first name is : <%=request.getString("first")%>
Your last name is : <%=request.getString("last")%>
using ASP : action.asp
your first name is : <%=request("first")%>
Your last name is : <%=request("last")%>

Collapse -

by kat97 In reply to
Collapse -

by kat97 In reply to Outputting form values in ...

This question was closed by the author

Back to Web Development Forum
5 total posts (Page 1 of 1)  

Related Discussions

Related Forums