简体   繁体   中英

HTML/jQuery or JSP script

I need to define a hierarchy of tables in HTML, with input fields.

<table>
    <input ...>
    <table>
        <input...>
        <submit button...>
    </table>
    <table>
        <input...>
        <submit button...>
    </table>
</table>

How may I write a code, so when pressing one of the submit buttons all input variables from the current and parent tables are sent over ? I want a button to fire one form, the second button another form. Different forms.


I need two distinct forms, one for the first button, another for the second.

Wrap the whole <table> in a <form> if you want everything to be submitted.

EDIT: I think I misunderstood your question. Please comment if I did. I will change my answer if that's the case.

Determine the parent and current table , to wrap up the table inside another you just need to arrive in this way ,

<form action="" method="">    
<table>
 <tr>
   <td><input /> </td>
   <td>
    <table>
     <tr>
      <td><input /> </td>
     </tr>
    </table>
   </td>
 </tr>
</table>
<input type="submit" />
</form>

And this form holds the inputs from both the tables , so that you might access them in the next jsp or servlet

Hope this helps !!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM