I want to get model_id[] value in foreach by click submit but i get all from model_id[].
In my form:
<form id="modify" class="form-horizontal" method="POST" action="{{ route('modifymodel') }}"
onsubmit="return confirm('Are you sure to do this?');">
{!! csrf_field() !!}
<table class="table-hover" width="100%" cellpadding="5" cellspacing="0">
@foreach($data_model as $key=> $va)
<tr>
<td width="30px">{{++$key}}</td>
<td width="280px">
<input type="hidden" id="model_id[]" name="model_id[]" value=" {{ $va->model_id }} ">
<input type="text" name="txt_depmo" id="txt_depmo" style="width: 280px;"
value="{{$va->model_name}}">
</td>
<td>
<input type="submit" class="btn btn-outline-primary" name="submit" id="submit" value="Updates">
<input type="submit" class="btn btn-outline-danger" name="submit" id="submit" value="Removes">
</td>
</tr>
@endforeach
</table>
</form>
My Controller:
public function modifymodel(Request $request){
$modelidd=Input::get('model_id');
}
but i got the result all array in model_id[].
["1","3","8","9"]
i want to get id from my button click