Javascript 数组类型输入返回第一个数组值,然后在克隆tr后返回全部
//我的表单(Form.blade.php) 我试图从表单中克隆多个tr的输入数据中获取数组数据,但它返回的是数组数据,而不仅仅是第一个数组值。如下所示:Javascript 数组类型输入返回第一个数组值,然后在克隆tr后返回全部,javascript,laravel,Javascript,Laravel,//我的表单(Form.blade.php) 我试图从表单中克隆多个tr的输入数据中获取数组数据,但它返回的是数组数据,而不仅仅是第一个数组值。如下所示: <!-- /.card-header --> <div class="card-body"> <table id="example
<!-- /.card-header -->
<div class="card-body">
<table id="example2" class="table table-bordered table-hover">
<thead>
<tr>
<th>Description</th>
<th>COA</th>
<th>Amount</th>
<th>Credit/Credit</th>
</tr>
</thead>
{{ Form::open(['action'=>'JournalController@store','method'=>'post']) }}
<tbody>
<tr>
<td>
<div class="input-group">
{!! Form::text('descriptions[]', null , array_merge(['class' => 'form-control','placeholder'=>'Enter Journal Description'])) !!}
</div>
</td>
<td>
<div class="input-group">
{!! Form::select('coas[]', $coa->pluck('name','id'),null, array_merge(['class' => 'form-control', 'placeholder' => 'Select COA'])) !!}
</div>
</td>
<td>
<div class="input-group">
{!! Form::number('amounts[]', null , array_merge(['class' => 'form-control'])) !!}
</div>
</td>
<td>
<div class="input-group">
{!! Form::select('debit_credits[]',['Debit','Credit'],null, array_merge(['class' => 'form-control', 'placeholder' => 'Journal Type'])) !!}
</div>
</td>
</tr>
</tbody>
<tfoot>
<tr>
<td colspan="4" class="text-right">
<div class="card-body">
{{ Form::submit('Register Journals',['class'=>'btn btn-info']) }}
</div>
</td>
</tr>
</tfoot>
{{ Form::close() }}
</table>
我提交表单后希望显示为输出的内容
array:5 [▼ /what I am expecting to see:
"_token" => "tQd6C56gZQofuOcEUOi5yLztEOem8CsS0J4OBp5J"
"descriptions" => array:1 [▼
0 => somedat,
1 => somedata,
2 => somedate
]
"coas" => array:1 [▼
0 => somedat,
1 => somedata,
2 => somedate
]
"amounts" => array:1 [▼
0 => somedat,
1 => somedata,
2 => somedate
]
"debit_credits" => array:1 [▼
0 => somedat,
1 => somedata,
2 => somedate
]
]
请让我知道我犯了什么错误
array:5 [▼
"_token" => "tQd6C56gZQofuOcEUOi5yLztEOem8CsS0J4OBp5J"
"descriptions" => array:1 [▼
0 => null
]
"coas" => array:1 [▼
0 => null
]
"amounts" => array:1 [▼
0 => null
]
"debit_credits" => array:1 [▼
0 => null
]
]
array:5 [▼ /what I am expecting to see:
"_token" => "tQd6C56gZQofuOcEUOi5yLztEOem8CsS0J4OBp5J"
"descriptions" => array:1 [▼
0 => somedat,
1 => somedata,
2 => somedate
]
"coas" => array:1 [▼
0 => somedat,
1 => somedata,
2 => somedate
]
"amounts" => array:1 [▼
0 => somedat,
1 => somedata,
2 => somedate
]
"debit_credits" => array:1 [▼
0 => somedat,
1 => somedata,
2 => somedate
]
]