我有Laravel表单,其中包含许多具有许多数据的多个选择元素。例如:
这是我的表单代码:
<div class="row">
<div class="panel panel-white">
<div class="panel-body">
<div class="col-md-12 col-sm-12">
<div class="form-group">
{{ Form::label('hotels', __('membership::main.hotels')) }}
{{ Form::select('hotels', $hotels, null, array('multiple'=>'multiple','name'=>'hotels[]', 'class' => 'multiselect form-control')) }}
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="panel panel-white">
<div class="panel-body">
<div class="col-md-12 col-sm-12">
<div class="form-group">
{{ Form::label('outlets', __('membership::main.outlets')) }}
{{ Form::select('outlets', $outlets, null, array('multiple'=>'multiple','name'=>'outlets[]', 'class' => 'multiselect form-control')) }}
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="panel panel-white">
<div class="panel-body">
<div class="col-md-12 col-sm-12">
<div class="form-group">
{{ Form::label('airports', 'Airport & Lounges') }}
{{ Form::select('airports', $airports, null, array('multiple'=>'multiple','name'=>'airports[]', 'class' => 'multiselect form-control')) }}
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="panel panel-white">
<div class="panel-body">
<div class="col-md-12 col-sm-12">
<div class="form-group">
{{ Form::label('beauty', 'Beauty & Fitness') }}
{{ Form::select('beauty', $beauty, null, array('multiple'=>'multiple','name'=>'beauty[]', 'class' => 'multiselect2 form-control')) }}
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="panel panel-white">
<div class="panel-body">
<div class="col-md-12 col-sm-12">
<div class="form-group">
{{ Form::label('attractions', 'Activities & Attractions') }}
{{ Form::select('attractions', $attractions, null, array('multiple'=>'multiple','name'=>'attractions[]', 'class' => 'multiselect2 form-control')) }}
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="panel panel-white">
<div class="panel-body">
<div class="col-md-12 col-sm-12">
<div class="form-group">
{{ Form::label('restaurants', 'Restaurant & Bars') }}
{{ Form::select('restaurants', $restaurants, null, array('multiple'=>'multiple','name'=>'restaurants[]', 'class' => 'multiselect3 form-control')) }}
</div>
</div>
</div>
</div>
</div>
我正在使用这个库来处理多选功能 https://github.com/davidstutz/bootstrap-multiselect
控制器中的我只是检查这样的数据,而不是我所有的选择都已提交,它停止了特定的限制,但我不知道为什么?
public function store(Request $request)
{
dd($request);
}
答案 0 :(得分:-1)
拥有这么多选择并不理想!但是,我建议你看看你的控制器。您可能会对结果进行分页。它也可能与浏览器有关。在我们看到你做了什么或你看到了什么之前,我们不能给你一个确切的答案......只有假设