写两个FORM,
或者在把name1的value取出写在test1.jsp后面,再encode一下
或者在TEST1.JSP中把NAME2的内容传给TEST2.JSP.就象Chain of Responsibility模式一样.

解决方案 »

  1.   

    <html>
     <head></head>
       <body>
        <form name=form1 action="test1.jsp">
        <table width=40% align="center">
        <tr>
          <td>名字1:</td><td><input type="text" name="name1" size=10></td>
        </tr>
    </table>
    </form>
    <form name=form2 action="test2.jsp">
    <table width=40% align="center">
       <tr>
         <td>名字2:</td><td><input type="text" name="name2" size=10></td>
       </tr>
      </table>
    <p align="center"><input type=button onclick="form1.submit()" value=提交1>
    <input type=submit value=提交2></form>
    </body>
    </html>
      

  2.   

    再看看这个贴
    http://expert.csdn.net/Expert/topic/1136/1136597.xml?temp=.2595178
      

  3.   

    <html>
     <head></head>
       <body>
        
        <table width=40% align="center">
        <tr>
          <td>名字1:</td><td>
    <form name=form1>
    <input type="text" name="name1" size=10></td>
    </form>
        </tr>
       <tr>
         <td>名字2:</td><td>
    <form name=form2>
    <input type="text" name="name2" size=10>
    </form>
    </td>
       </tr>
      </table>
    <p cursor=hand align="center" onclick="document.form1.action='text1.jsp';document.form1.submit();">提交</p>
    <p cursor=hand onclick="document.form2.action='text2.jsp';document.form2.submit();">提交1</a>
    </body>
    </html>
      

  4.   

    可以放在同一个form1里面吧<p cursor=hand align="center" onclick="document.form1.action='text1.jsp';document.form1.submit();">提交</p>
    <p cursor=hand onclick="document.form1.action='text2.jsp';document.form1.submit();">提交1</a>
      

  5.   

    我不在希望用两个form,用一个form希望通帮助我解决,我写又写了一个jsp程序,希望大家提出解决方案
    <%@ page import = "java.net.URL" %>
    <%@ page import = "java.sql.*" %>
    <%@ page import = "java.lang.System" %>
    <%@ page import = "java.util.Hashtable" %>
    <%@ page import = "java.util.Enumeration" %>
    <%
    //保存参数
    Enumeration enum = request.getParameterNames();
    Hashtable hashReq= new Hashtable();
    while(enum.hasMoreElements())
    {
    Object strKey=enum.nextElement();
    hashReq.put(strKey, request.getParameter(strKey.toString()));
    }
    <%
      

  6.   

    要求还挺高,下面的代码希望如你所愿
    <html>
     <head></head>
       <body>
        <form name=form1>
        <table width=40% align="center">
        <tr>
          <td>名字1:</td><td><input type="text" name="name1" size=10></td>
        </tr>
       <tr>
         <td>名字2:</td><td><input type="text" name="name2" size=10></td>
       </tr>
      </table>
    <p align="center">
    <input type=button onclick="name2.disabled=true;form1.action='test1.jsp';form1.submit()" value=提交1>
    <input type=button onclick="name1.disabled=true;form1.action='test2.jsp'; form1.submit()" value=提交2>
    </form>
    </body>
    </html>