我有一个表单页面和详细信息页面。当我从表单页面输入和提交数据时,它将重定向到详细信息页面。而且我不知道如何显示我提交给selectpicker的数据?它显示,但在下面的图像中加倍..
<select id="set1" name="res_destination" class="selectpicker form-control edit" data-live-search="true" style="width:100%" disabled required>
<option>{{ $data[0]->DESTINATION }}</option>
<option></option>
@foreach($destination as $getData)
<option value="{{$getData->REF_TEXT}}"> {{$getData->REF_TEXT}} </option>
@endforeach
</select>
答案 0 :(得分:3)
使用selected
选择下拉值。
<select id="set1" name="res_destination" class="selectpicker form-control edit" data-live-search="true" style="width:100%" disabled required>
@foreach($destination as $getData)
<option value="{{$getData->REF_TEXT}}" @if($data[0]->DESTINATION==$getData->REF_TEXT) selected @endif> {{$getData->REF_TEXT}} </option>
@endforeach