Jquery 表单序列化不';行不通
I'vegot遵循ICanHaz表单模板:Jquery 表单序列化不';行不通,jquery,forms,serialization,twitter-bootstrap,Jquery,Forms,Serialization,Twitter Bootstrap,I'vegot遵循ICanHaz表单模板: <script id="outcomeFormTemplate" type="text/html"> <form id="xyz" class="form-horizontal well" data-async data-target="#outcomeFormDialog" method="POST"> <div class="modal-header"> <b
<script id="outcomeFormTemplate" type="text/html">
<form id="xyz" class="form-horizontal well" data-async data-target="#outcomeFormDialog" method="POST">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h3 id="myModalLabel">Add outcome</h3>
</div>
<div class="modal-body">
<fieldset>
<label>Amount</label>
<div class="input-append">
<input type="text" placeholder="00.01" />
<span class="add-on">{{ currency }}</span>
</div>
{{>UserSelectTemplate}}
{{>CategorySelectTemplate}}
<label>Comment</label>
<input type="text" placeholder="Comment here..." />
</fieldset>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal">Close</button>
<button type="submit" class="btn btn-primary">Save outcome</button>
</div>
</form>
</script>
您需要设置表单字段的名称。否则它不知道如何命名字段。我从来没有尝试过没有,所以我不知道通常会发生什么,但这是有意义的 例如:
<select name="user">
查找输入的name属性,以便在其工作的输入中使用name属性
<label>Amount</label>
<div class="input-append">
<input type="text" name='amt' placeholder="0.01">
<span class="add-on">zł</span>
</div>
金额
zł
如上所述,在输入中使用name属性,它可以工作。谢谢!我一辈子都想不出这个。引导程序应该在其示例中包含名称和字段。
<label>Amount</label>
<div class="input-append">
<input type="text" name='amt' placeholder="0.01">
<span class="add-on">zł</span>
</div>
<label>Amount</label>
<div class="input-append">
<input type="text" name='amt' placeholder="0.01">
<span class="add-on">zł</span>
</div>