aspose file tools*
The moose likes JSP and the fly likes Passing Parameters through JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Passing Parameters through JSP" Watch "Passing Parameters through JSP" New topic
Author

Passing Parameters through JSP

Shyam Kasthala
Ranch Hand

Joined: Mar 30, 2006
Posts: 48
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.


Thanks & Regards<br /> Shyam Kasthala<br />ILFS Infotech Limited
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

Why do your textboxes have the same name ? I think you should give them different names.


[My Blog]
All roads lead to JavaRanch
Shyam Kasthala
Ranch Hand

Joined: Mar 30, 2006
Posts: 48
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

Joined: Mar 30, 2006
Posts: 48
Hi,
the number of text boxes depends on the columns of the field_activity_id.
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

You need to set the name of each input field dynamically
Shyam Kasthala
Ranch Hand

Joined: Mar 30, 2006
Posts: 48
Hi,
Can you tell me how should i set each input field dynamically.Thank you in advance.
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

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.
 
Don't get me started about those stupid light bulbs.
 
subject: Passing Parameters through JSP