算你走运,前段时间我也遇到这样的问题,现在解决了
我给你一个简单的例子,你慢慢琢磨吧。<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head><body>
<!--<p id="myParagraph">This is a sample paragraph.</p>-->  <table width="200" border="1" id="myParagraph">
    <tr onClick="document.myframe.aa.tt.value='hello,my dear'">
      <td>&naaaabsp;</td>
    </tr>
  </table>
<iframe src='2.htm' id="ww" width=200 height=100 name=myframe FrameBorder=0 scrolling=no >
</iframe>
</body>
</html>*******************************************************************************<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head><body>
<form  id="qq" name="aa">
<input type="text" id="tt" value="ladjsfajfla">
</form>
</body>
</html>

解决方案 »

  1.   

    代码如下(简):
    //main.jsp
    <html><body>
    <iframe name=frame1 src="list.jsp"></IFRAME>
    <iframe name=frame2 src="action.jsp"></IFRAME>
    ---------------------------------------------------
    //list.jsp
    ...
     while(rs.next()){
     out.println("<tr ><td  width=\"14%\" height=\"22\">"+rs.getString(1)+"</td>"
                       +"<td width=\"14%\" height=\"22\">"+rs.getString(2)
                       +"</td></tr>" );
    ...
    ----------------------------------------------------------
    //action.jsp
    ...
    <form name=form1 action=do>
    <input name=a >
    <input name=b>
    </form>
    ...
    ------------------------------------
    我的初步想法是在list.jsp中每一行添加一个隐藏字段<input type=hidden value=rs.getstring(3)>
    然后在<tr onclick()>取得这个隐藏的value,传到action.jsp中,再查询数据库,把相应字段放过去。
    请会JAVASCRIPT的朋友帮实现一下,或者有更好的方法的朋友来支招。