Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-21-2005, 07:12 AM   PM User | #1
tllcll
New Coder

 
Join Date: Aug 2005
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
tllcll is an unknown quantity at this point
how to display value in textbox

I have a form, 1st page called first.jsp. in this form I have multiple fields. once user enters the first field, I call to the second.jsp to process by using 'onchange="location.href='second.jsp?first_field='+this.value"'

in second.jsp, it will get the value for 2nd field and return to first.jsp. I manage to get the value returned to first.jsp but not able to display in the second field textbox.

how do I do it
tllcll is offline   Reply With Quote
Old 10-21-2005, 07:40 AM   PM User | #2
Philip M
Supreme Master coder!

 
Philip M's Avatar
 
Join Date: Jun 2002
Location: London, England
Posts: 17,044
Thanks: 197
Thanked 2,412 Times in 2,390 Posts
Philip M has a spectacular aura aboutPhilip M has a spectacular aura aboutPhilip M has a spectacular aura about
Please show us your code, otherwise is is pretty well impossible to respond sensibly.
Philip M is offline   Reply With Quote
Old 10-21-2005, 07:54 AM   PM User | #3
tllcll
New Coder

 
Join Date: Aug 2005
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
tllcll is an unknown quantity at this point
as requested, the following is part of the coding

part of the coding - first.jsp
---------------------------
<%
String itemDesc = (String) request.getAttribute("materialDesc") ;
if( itemDesc != null){
System.out.println("aaa " +itemDesc);
%>
<%}%>

<html>
....
<body>
<%
int i;
for (i=1;i<=15;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, this.form.materialDesc<%=i%>.value=<%=itemDesc%>, openRow(<%=i%>);">
</td>

<td width="19%">
<input type="text" name="materialDesc<%=i%>" style="width:100%" value="" disabled>
</td>

second.jsp
----------
<%@page import="java.sql.*,java.lang.Object,java.lang.String,java.lang.*,java.util.*,java.text.SimpleDateFor mat, java.text.*"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
<jsp:useBean id = "trx" class="trx.TransDetails" scope="request" />

<% String in_num = request.getParameter("in_num");
String materialDesc = trx.getItem(in_num); //now a getter
request.setAttribute("materialDesc" , materialDesc ) ;
RequestDispatcher rd = request.getRequestDispatcher("transaction_main.jsp") ;
rd.forward(request, response) ;
%>
tllcll is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:20 AM.


Advertisement
Log in to turn off these ads.