我正在使用laravel + bootstrap和jquery等创建一个应用程序。现在我想进行jquery multiselect,但我不知道如何显示我在数据库中的值。你能帮我吗?这就是我实际拥有的东西:
<form action="{{ action('Player@store') }}" method="post" class="form-horizontal">
{{ csrf_field() }}
<div class="row">
<div class="col-xs-5">
<select name="from[]" id="multiselect" class="form-control" size="8" multiple="multiple">
<option value="1">Item 1</option>
<option value="2">Item 5</option>
<option value="2">Item 2</option>
<option value="2">Item 4</option>
<option value="3">Item 3</option>
</select>
</div>
<div class="col-xs-2">
<button type="button" id="multiselect_rightAll" class="btn btn-block">
<i class="fa fa-angle-double-right" aria-hidden="true"></i>
</button>
<button type="button" id="multiselect_rightSelected" class="btn btn-block">
<i class="fa fa-angle-right" aria-hidden="true"></i></button>
<button type="button" id="multiselect_leftSelected" class="btn btn-block">
<i class="fa fa-angle-left" aria-hidden="true"></i>
</button>
<button type="button" id="multiselect_leftAll" class="btn btn-block">
<i class="fa fa-angle-double-left" aria-hidden="true"></i>
</button>
</div>
<div class="col-xs-5">
<select name="to[]" id="multiselect_to" class="form-control" size="8" multiple="multiple"></select>
</div>
</div>
<script type="text/javascript">
jQuery(document).ready(function($) {
$('#multiselect').multiselect();
});
</script>
<button type="submit" class="btn btn-success">@lang('main.save')</button>
</form>