0

我有一个动态 html 表单,它使用 javascript 为某些产品创建新输入,并且每个产品都有更多颜色。

<input type="text name="products[]">
<input type="text name="colors[]">

我如何创建此 html 代码,以便当我将它们放在帖子中时,我可以将它们与 for 关联起来。

4

1 回答 1

1

像这样做:

<input type="text name="products[product_index][name]">
<input type="text name="products[product_index][colors][]">

或者 :

<input type="text name="products[product_index]">
<input type="text name="[colors][product_index][]">
于 2014-03-02T04:21:17.340 回答