简体   繁体   English

HTML / jQuery或JSP脚本

[英]HTML/jQuery or JSP script

I need to define a hierarchy of tables in HTML, with input fields. 我需要使用输入字段在HTML中定义表的层次结构。

<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. 如果要提交所有内容,请将整个<table>包裹在<form>

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 这种形式保存了两个表的输入,因此您可以在下一个jspservlet访问它们。

Hope this helps !! 希望这可以帮助 !!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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