我有一个动态表单,用户可以在其中向表单添加其他行。最终,我想获取此数据并将其提交到我的数据库,并带有插入,更新或删除的条件,但现在我只想检索数组值。每当我点击提交时,它只会进入空白的白页。
以下是表格:
<form id="" class="form" name="parts" method="post" action="http://website.com/home/wp-content/themes/Avada-child/update-list.php">
<table class="table table-bordered">
<thead>
<tr>
<th>First Name</th>
<th>Last Name</th>
<th>County</th>
<th>Street</th>
<th>City</th>
<th>Ward</th>
<th>Precinct</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<tr>
<td style="display:none;">
<input type="hidden" class="form-control" name="username[]" id="username" value="user">
</td>
<td>
<input onkeyup="valid(this)" onblur="valid(this)" type="text" class="form-control" name="first_name[]" id="first_name">
</td>
<td>
<input onkeyup="valid(this)" onblur="valid(this)" type="text" class="form-control" name="last_name[]" id="last_name">
</td>
<td>
<input onkeyup="valid(this)" onblur="valid(this)" type="text" class="form-control" name="county[]" id="county">
</td>
<td>
<input onkeyup="valid(this)" onblur="valid(this)" type="text" class="form-control" name="street[]" id="street">
</td>
<td>
<input onkeyup="valid(this)" onblur="valid(this)" type="text" class="form-control" name="city[]" id="city">
</td>
<td>
<input onkeyup="valid(this)" onblur="valid(this)" type="text" class="form-control" name="ward[]" id="ward">
</td>
如果我没有名称作为 name[],我可以让表单行回显,以便我知道表单正在发布数据。但是一旦我将名称转换为数组,名称[]我似乎无法获取数据。我做错了什么?
绝地无双
慕姐8265434