2016-11-14 65 views
0

我使用Bootstrap和jQuery,并且在将值从FORM传递到PHP时遇到了问题,在这种情况下是同一页面。Jquery使用Bootstrap形成多个字段

我的代码是:

<tr> 
    <td><input type="text" name="descricao[]" ></td> 
    <td><span class="spanpreco"><input type="text" name="quantidade[]" ></span></td> 
    <td><span class="spanpreco"><input type="text" name="preco[]"></span></td> 
    <td><input type="text" name="subtotal[]" disabled></td> 
</tr> 

然后我的jQuery是这样的:

$("#adicionar").click(function(){ 
      $("#linha").append('<tr><td><input type="text" name="descricao[]"></td><td><span class="spanpreco"><input type="text" name="quantidade[]" ></span></td><td><span class="spanpreco"><input type="text" name="preco[]"></span></td><td><input type="text" name="subtotal[]" disabled></td></tr>'); 
     }); 

这里的问题是,当我发布的数据PHP,每一个栏,我动态添加到表单不会传递给PHP,结果行数始终为1。

有人可以帮我吗?

+0

只是一个奇怪的问题,这是怎么'的Twitter bootstrap'有关?我只看到jQuery。也许你会有更好的[Google](https://www.google.nl/search?q=Jquery+form+multiple+fields)结果。 – Xorifelse

+0

你好,你是对的,这是jQuery。谢谢。 –

回答

0

我发现问题,<FORM></FORM>是在错误的地方。

感谢和问候,

阿德尔莫

+0

回想起来,我们在哪里可以找到这个解决方案?显然这不是答案的一部分。 – Xorifelse

+0

我提交了验证码,

为红色。谢谢。 –

相关问题