Please support our JSP advertiser: Lunarpages JSP Web Hosting
![]() |
•
•
Join Date: Aug 2005
Posts: 10
Reputation:
Rep Power: 4
Solved Threads: 0
Hi,
I would like to know how to assign and display the value to a column name 'item_name' in first.jsp
I have 2 jsp pages - first.jsp , second.jsp. The first.jsp will call the second.jsp and pass in the value. In the second.jsp, I will call the method in the bean file. how do I assign the value and return to the first.jsp.
In second.jsp, i manage the get the value for itemDesc but not sure how to assign this to the column 'item_name' in first.jsp
TQ
The following codes for yr ref
second.jsp
--------------
<jsp:useBean id = "trx" class=".trx.TransDetails" scope="request" />
<% String in_num = request.getParameter("in_num");
String itemDesc = trx.getItem(in_num); // pass in the code and get from database the desc, and return to itemDesc to be display in first.jsp
%>
<script>
window.history.back();
</script>
first.jsp - part of the html body
------------------------------------
<table border="1" width="100%">
<tr>
<th bgcolor="#99CCFF" width="3%">No.</th>
<th bgcolor="#99CCFF" width="15%">Item Code</th>
<th bgcolor="#99CCFF" width="25%">Item Name</th>
</tr>
<%
int i;
for (i=1;i<=5;i++) {%>
<tr>
<td width="3%"><center><%=i%></center></td>
<td width="15%">
<input type="text" name="item_num<%=i%>"
style="width:100%;text-align:left;" maxlength=15
onChange="location.href='second.jsp?in_num='+this.value,
openRow(<%=i%>);">
</td>
<td width="19%">
<input type="text" name="materialDesc<%=i%>"
style="width:100%" value="" disabled>
</td>
</tr>
</table>
I would like to know how to assign and display the value to a column name 'item_name' in first.jsp
I have 2 jsp pages - first.jsp , second.jsp. The first.jsp will call the second.jsp and pass in the value. In the second.jsp, I will call the method in the bean file. how do I assign the value and return to the first.jsp.
In second.jsp, i manage the get the value for itemDesc but not sure how to assign this to the column 'item_name' in first.jsp
TQ
The following codes for yr ref
second.jsp
--------------
<jsp:useBean id = "trx" class=".trx.TransDetails" scope="request" />
<% String in_num = request.getParameter("in_num");
String itemDesc = trx.getItem(in_num); // pass in the code and get from database the desc, and return to itemDesc to be display in first.jsp
%>
<script>
window.history.back();
</script>
first.jsp - part of the html body
------------------------------------
<table border="1" width="100%">
<tr>
<th bgcolor="#99CCFF" width="3%">No.</th>
<th bgcolor="#99CCFF" width="15%">Item Code</th>
<th bgcolor="#99CCFF" width="25%">Item Name</th>
</tr>
<%
int i;
for (i=1;i<=5;i++) {%>
<tr>
<td width="3%"><center><%=i%></center></td>
<td width="15%">
<input type="text" name="item_num<%=i%>"
style="width:100%;text-align:left;" maxlength=15
onChange="location.href='second.jsp?in_num='+this.value,
openRow(<%=i%>);">
</td>
<td width="19%">
<input type="text" name="materialDesc<%=i%>"
style="width:100%" value="" disabled>
</td>
</tr>
</table>
![]() |
Similar Threads
Other Threads in the JSP Forum
- which is the best technology to make online shopping cart? (IT Professionals' Lounge)
- how to call javabean from jsp (JSP)
- shopping cart using jsp, servlet, javabean (Community Introductions)
- how to call javabean from jsp page upon onChange event (JSP)
- how to get value from popup (JSP)
- best design (JSP)
Other Threads in the JSP Forum
- Previous Thread: any body-urgent
- Next Thread: how to get value from popup
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)





Linear Mode