在 Laravel 中调整表单组中的复选框
Resizing checkbox in form group in Laravel
<div class="col-md-3">
<div class="white-box">
{{ Form::open(['route' => ['resources.select'], 'method' => 'ANY', 'role' => 'select']) }}
<div class="form-group">
{{ Form::label('category_label', 'Categories : ') }}
{{ Form::select('category_select', $category_select, ['class'=>'form-control']) }}
{{ Form::button('Submit',['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10', 'id'=>'select_resource']) }}
</div>
{{ Form::close() }}
</div>
</div>
这是我的代码。我有三个不同的 div 看起来一样。当我尝试更改为网格视图时,select 框与 div 块保持重叠。
我希望他们留在视图中的块内。
您的 select 重叠的原因是您在声明中缺少 null 作为参数。
更改此行;
{{ Form::select('category_select', $category_select, ['class'=>'form-control']) }}
到此;
{{ Form::select('category_select', $category_select, null, ['class'=>'form-control']) }}
此外,您不需要
来设置表单样式。在您的问题中创建表单的更有效方法如下例所示
<div class="col-md-3">
<div class="white-box">
{{ Form::open(['route' => ['resources.select'], 'method' => 'ANY', 'role' => 'select']) }}
<div class="form-group">
{{ Form::label('category_label', 'Categories : ') }}
{{ Form::select('category_select', $category_select, null, ['class'=>'form-control']) }}
</div>
{{ Form::button('Submit',['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10', 'id'=>'select_resource']) }}
{{ Form::close() }}
</div>
</div>
<div class="col-md-3">
<div class="white-box">
{{ Form::open(['route' => ['resources.select'], 'method' => 'ANY', 'role' => 'select']) }}
<div class="form-group">
{{ Form::label('category_label', 'Categories : ') }}
{{ Form::select('category_select', $category_select, ['class'=>'form-control']) }}
{{ Form::button('Submit',['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10', 'id'=>'select_resource']) }}
</div>
{{ Form::close() }}
</div>
</div>
这是我的代码。我有三个不同的 div 看起来一样。当我尝试更改为网格视图时,select 框与 div 块保持重叠。 我希望他们留在视图中的块内。
您的 select 重叠的原因是您在声明中缺少 null 作为参数。
更改此行;
{{ Form::select('category_select', $category_select, ['class'=>'form-control']) }}
到此;
{{ Form::select('category_select', $category_select, null, ['class'=>'form-control']) }}
此外,您不需要
来设置表单样式。在您的问题中创建表单的更有效方法如下例所示
<div class="col-md-3">
<div class="white-box">
{{ Form::open(['route' => ['resources.select'], 'method' => 'ANY', 'role' => 'select']) }}
<div class="form-group">
{{ Form::label('category_label', 'Categories : ') }}
{{ Form::select('category_select', $category_select, null, ['class'=>'form-control']) }}
</div>
{{ Form::button('Submit',['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10', 'id'=>'select_resource']) }}
{{ Form::close() }}
</div>
</div>