我在网站上销售的产品创建一个页面。我想在每个产品附近添加一个“添加到购物车”按钮,其中列出的标记类似于:
Product Name 1
Extra information on the product 1.
Product Name 2
Extra information on the product 2.
...
由于提交输入将具有不同的名称(包括产品的代码),所以最大的问题是:我应该在一个表单中包装整个产品列表,还是应该为每个产品创建一个表单?在代码中:
Product Name 1
Extra information on the product 1.
Product Name 2
Extra information on the product 2.
要么…
Product Name 1
Extra information on the product 1.
Product Name 2
Extra information on the product 2.
哪一个是最佳实践?任何严重的原因不使用一个或另一个,或者我是做完全错了吗?