在单个表中包含多个表单的正确方法 [英] Proper way to include multiple forms in a single table

查看:22
本文介绍了在单个表中包含多个表单的正确方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有在一个表格中包含多个表单的正确方法?

Is there a correct way to include multiple forms in a single table?

比如我有8行,其中四行对应一个表,另外四行对应一个秒.什么是最好的方法来做到这一点?我知道在 TR 之间放置表格是无效的.

For example, I have 8 rows, four of them correspond to a single table, the other four correspond to a second. What would be the best way to do this? I know putting a table between TRs is invalid.

推荐答案

我认为没有标准的方法可以做到这一点.(这很糟糕)

I don't think there is a standard way to do this. (which sucks)

您必须执行一些操作,例如为一行中的所有表单元素提供前缀以指示它们所在的行,然后检测按下了哪个按钮.在服务器上,您可以丢弃所有您不感兴趣的值.

You'll have to do something like give all the form elements in a row a prefix to indicate which row they are in, then detect which button was pressed. On the server you can then discard all the values that you aren't interested in.

edit:未按下按钮的信息(名称和值)不会被提交)

edit: The information (name and value) of the buttons not pressed won't be submitted)

(或者,如果您使用 javascript,您应该能够在按下按钮时从该行的输入中收集所有值.)

(Alternatively, if you use javascript you should be able to make work around to collect all the values from that row's inputs when the button is pressed.)

这篇关于在单个表中包含多个表单的正确方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆