Q
Quick Function
I am writing jsp. The first page asks user to input the number of
children he has and then goes to page 2. In page 2, the user is asked
to input name and address for each child. In page3, I want to go
through each children and do something.
In page 1, I got the number of children and send the information to
page 2.
In page 2, I have a table like this:
<form action="page3.jsp">
<table>
<c:forEach start="0" end="${param.number_of_children}" var="index">
<tr>Name <input type="text" name="n${index}">, Address <input
type="text" name="a${index}"></tr>
</c:forEach>
</table>
<input type="sumbit">
</form>
In page3, I have:
<c:forEach start="0" end="${param.number_of_children}" var="index">
<cut value="${param.n${index}}"/>
<cut value="${param.a${index}}"/>
</c:forEach>
But looks like the "${param.n${index}}" does not work. How can I
access to the information about each child? Is the whole a approach a
good one or there is a better approach?
Thanks,
qq
children he has and then goes to page 2. In page 2, the user is asked
to input name and address for each child. In page3, I want to go
through each children and do something.
In page 1, I got the number of children and send the information to
page 2.
In page 2, I have a table like this:
<form action="page3.jsp">
<table>
<c:forEach start="0" end="${param.number_of_children}" var="index">
<tr>Name <input type="text" name="n${index}">, Address <input
type="text" name="a${index}"></tr>
</c:forEach>
</table>
<input type="sumbit">
</form>
In page3, I have:
<c:forEach start="0" end="${param.number_of_children}" var="index">
<cut value="${param.n${index}}"/>
<cut value="${param.a${index}}"/>
</c:forEach>
But looks like the "${param.n${index}}" does not work. How can I
access to the information about each child? Is the whole a approach a
good one or there is a better approach?
Thanks,