如何在JSP页面中使用2个表单,一个多部分Post和另一个简单的Post

时间:2014-05-04 13:09:37

标签: mysql forms jsp servlets

我想在JSP页面中使用两个表单,其中一个表单是enctype="multipart/form-data"而另一个表单是简单的Post方法,但它不起作用。我该怎么处理这个?

1)

<form action="NewUserRegn" method="POST">
  <table class="mai">
      <tr>
        <td>
            <table class="entry">
               <tr class="entry">
                   <th class="entry" colspan="2">
                        Personal Details
                   </th>
               </tr>
               <tr>
                   <td class="entry">
                         Candidate's Name :<br>
                         <p>(As given in Matriculation Certificate)</p>
                   </td>
                   <td class="entry">
                         <input type="text" name="cdname" size="35" />
                   </td>
                 </tr>
                 <tr>
                   <td class="entry">
                         Gender :
                   </td>
                   <td class="entry">
                       <input type="radio" name="gender" value="Male"  />Male
                       <input type="radio" name="gender" value="Female" />Female
                   </td>
                 </tr>
   </table>
  </form>

2)

  <form name="docs"
        action="NewUserRegn"
        method="POST" 
        enctype="multipart/form-data">
   <table class="mai">
    <tr>
     <td>
      <table class="entry">
        <tr>
           <th class="entry" colspan="2">
                Documents Upload
           </th>
        </tr>
        <tr>
           <td class="entry">
              Photograph : <input type="file" name="photo" accept="image/*"/>
           </td>
           <td class="entry">
              Signature : <input type="file" name="sign" accept="image/*"/>
           </td>
         </tr>
       </table>
      </td>
     </tr>
     <tr>
         <td>
             &nbsp;
         </td>
         <td>
             &nbsp;
         </td>
      </tr>
      <tr>
         <td>
            <table class="mai">
               <tr>
                  <td>
                    <input type="submit"
                           value="Recheck"
                           name="recheck" /></center>
                 </td>
                 <td>
                     <input type="submit" value="Submit" />
                 </td>
                </tr>
            </table>
</form>

0 个答案:

没有答案