i have 2 html pages as below:
page1.html:
<html><head>
<title>page1</title>
</head>
<body>
<table>
<tr><td>
Do you have cars?
<input type="radio" name="havecars" value="yes">yes
<input type="radio" name="havecars" value="no">no
</td></tr>
<tr>
<td>No:of cars
<select name="cars">
<option>1</option>
<option>2</option>
<option>3</option>
</select></td></tr>
<tr><td>
<input type="button" value="next">
</td></tr>
</table>
</body></html>
page2.html
<html><head><title>page 2</title></head>
<table><tr><td>
have cars?
<input type="radio" name="havecars" value="yes">yes
<input type="radio" name="havecars" value="no">no
</td></tr>
<tr><td>
no:of cars
<input type="text">
</td></tr>
</table>
</html>
when I enter the values for the fields in page1 and click next I should
go to page2, which should already have its fields populated depending
on the values in page1...
Using JSP and servlets how do I do that?
thanks,
John O'Conner - 23 Feb 2006 16:14 GMT
> when I enter the values for the fields in page1 and click next I should
>
[quoted text clipped - 3 lines]
>
> thanks,
page1's "next" button should submit its contents (use a form) to a
servlet. That servlet will process the page1 form data and will then
forward to a page2.jsp. page2.jsp will populate the fields as you
require, and generate the page2.html that you need.
Use Google to search on things like "html+form", "html submit",
etc...that will get you started:
1. submit the form data
2. process it at the server
3. send it back via a jsp page
Solve each step in order.
Regards,
John O'Conner
Hal Rosser - 24 Feb 2006 03:47 GMT
> i have 2 html pages as below:
>
[quoted text clipped - 43 lines]
> on the values in page1...
> Using JSP and servlets how do I do that?
You have input tags - but they are not inside a form tag.
The form tag determines where to send the data when the user clicks the
submit button.
Take a look at http://www.w3schools.com
where you'll see some html tutorials to get you up to speed on the html code
for submitting data to a jsp (or asp, or cgi, or php ...) page.