I am new to JSP and don't have much idea. So just let me clarify my requirement.
Say I have a program as below, where there's a First.jsp
with an array Match_List[5]
.
String[] Match_List;
Match_List[] = {a, b, c, d, e};
<form name="Team_Playerdetails" method="post" action="db_Match_Edit.jsp">
<TABLE>
<% for (int j = 0; j < 10; j++) { %>
<TR>
<TD>
<SELECT name="Stat_Match_name">
<% for (int i = 0; i < 5; i++) { %>
<option>
<% out.println(Match_List[i][1]); %>
</option>
<% } %>
</SELECT>
</TD>
</TR>
<% } %>
</TABLE>
<input type="submit" name="submit" value="Add All" tabindex="10" class="button" />
</form>
Now this form above will display a same drop down lists 10 times. I want to select different options in these ten lists say like below:
List_1 Option: a
List_2 Option: d
List_3 Option: e
List_4 Option: b
List_5 Option: c
.....
List_10 Option: d
Now I need that once user clicks the submit button then the variable should be moved to db_Match_Edit.jsp
. Here I will have the code to catch the value as
U_Stat_Match_name = request.getParameter("Stat_Match_name");
But since all the 10 drop down options are getting caught by the same select variable name Stat_Match_name
. So on db_Match_Edit.jsp
I am only getting the last selected option in U_Stat_Match_name
.
But I need all the 10 selected options in the db_Match_Edit.jsp
jsp in an array.