I have a form with some fields normal fields as well as the array fields but when I'm submitting the form everything working alright but I'm getting array fields to value only the index is zero I don't know why this is happening this is happening
This is the response I'm getting when printing the request value where I have append two many rows but the response is the only index with zero fields
Array
(
[txt_location] => Array
(
[0] => Uttar Pradesh
)
[txt_traveldate] => Array
(
[0] => 2019-04-06
)
[txt_age] => Array
(
[0] => 2
)
[txt_from] => Array
(
[0] => Delhi
)
[txt_to] => Array
(
[0] => Allahabad
)
[transport] => Array
(
[0] => Flight
)
[txt_departure] => Array
(
[0] => 10:30
)
[txt_preference] => Array
(
[0] => No preferred
)
[txt_remark] => Array
(
[0] => Remark qts 2
)
[txt_hotel] => Array
(
[0] => Kanha Shyam
)
[txt_checkin_date] => Array
(
[0] => 2017-04-06
)
[txt_checkin_time] => Array
(
[0] => 10:50
)
[txt_checkout_date] => Array
(
[0] => 2017-04-08
)
[txt_remarks] => Array
(
[0] => what to say
)
[submit] =>
)
This is the array fields which I'm appending using the help of jquery
<tr>
<td width="5%">
<a href="#" class="btn btn-danger btn-xs delete-row"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></a>
</td>
<td><input type="text" name="txt_traveldate[]" class="form-control" placeholder="Date"></td>
<td><input type="number" name="txt_age[]" class="form-control" placeholder="Age"></td>
<td><input type="text" name="txt_from[]" class="form-control" placeholder="From" id="search-term"></td>
<td><input type="text" name="txt_to[]" class="form-control" placeholder="To"></td>
<td>
<select name="transport[]" class="form-control">
<option value="Flight">Flight</option>
<option value="Train">Train</option>
<option value="Bus">Bus</option>
<option value="Cab">Cab</option>
</select>
</td>
<td><input type="text" name="txt_departure[]" class="form-control" placeholder="Dep. Arr.Time"></td>
<td><input type="text" name="txt_preference[]" class="form-control" placeholder="Preferances"></td>
<td><input type="text" name="txt_remark[]" class="form-control" placeholder="Remarks"></td>
</tr>
Why am I getting data with zero indexes only?