Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Passing Parameters through JSP

 
Shyam Kasthala
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all,
I have a jsp page where i have a list box.when i select a value from the list box and submit it, i will get some names with text boxes with the same name to all associated with it.Now i wan to enter some value into the text box and submit it again.I have done all these appropriately but the first text box value is only passed.Now how can i pass the all the text box values to the next page.Please reply me.Thanks in advance.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why do your textboxes have the same name ? I think you should give them different names.
 
Shyam Kasthala
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Here is the important Part of my code :-

<%
ResultSet rs1=st.executeQuery("select * from mgsch.actual where field_activity_id='"+actid+"'");
%>
<p align="center"><em><strong><font color="Green" size="+3"><strong>Measures
List</strong></font></em></p>
<table width="50%" border="0" align="center">
<%
int i = 0;
while(rs1.next())
{%>
<tr>
<td width="25%" align="center"><font color="Green"><strong><%=rs1.getString(2)%></strong></font></td>
<td width="25%" align="center"><input type="text" name="measure"></td>
</tr>
<%
i++;
}%>
</table>
 
Shyam Kasthala
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
the number of text boxes depends on the columns of the field_activity_id.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to set the name of each input field dynamically
 
Shyam Kasthala
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Can you tell me how should i set each input field dynamically.Thank you in advance.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think that you want to retrieve which textbox corresponds to which element in your database after submitting. One wway to do it is to concatenate the primary key of your table to the name of the textbox.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic