我有一个动态表单,可以有n行,所以字段名称是一个数组。但是我遇到的问题是,当textarea为空时,该值不会被提交
这导致数组数据的长度不一致(所有数组的长度应为5长,但只有2个注释填充,导致数据滑入错误的行)
我如何发布它以使结果数组为['','','','Mr Fields','No 543']
?
以下是三行
的示例<tr>
<td><input type="hidden" name="RateId[]" value="23"><input
type="text" name="Date[]" value="2013.08.23"
class="datepicker required hasDatepicker" id="dp1378446864655"></td>
<td>Meeting Room A
<textarea placeholder="Note" name="Note[]"
style="height: 26px;"></textarea></td>
<td class="calc"><input type="number" min="1" name="Count[]"
style="width: 3em" value="1"> x <input type="hidden"
name="Nights[]" value="1">
<div class="pull-right">
IDR <input type="number" min="1" name="Value[]" value="3000000">
</div></td>
</tr>
<tr>
<td><input type="hidden" name="RateId[]" value="22"><input
type="text" name="Date[]" value="2013.08.23"
class="datepicker required hasDatepicker valid" id="dp1378446864653"></td>
<td>Airport drop off
<textarea placeholder="Note" name="Note[]"
style="height: 26px;">Mr Fields</textarea></td>
<td class="calc"><input type="number" min="1" name="Count[]"
style="width: 3em" value="1"> x <input type="hidden"
name="Nights[]" value="1">
<div class="pull-right">
IDR <input type="number" min="1" name="Value[]" value="250000">
</div></td>
</tr>
<tr>
<td><input type="hidden" name="RateId[]" value="26"><input
type="text" name="Date[]" value="2013.08.23"
class="datepicker required hasDatepicker" id="dp1378446864654"></td>
<td>Restaurant Bill
<textarea placeholder="Note" name="Note[]"
style="height: 26px;">No 543</textarea></td>
<td class="calc"><input type="hidden" name="Count[]" value="1"><input
type="hidden" name="Nights[]" value="1">
<div class="pull-right">
IDR <input type="number" min="1" name="Value[]" value="100">
</div></td>
</tr>