1.html
<select class="form-control selectpicker" name="wid" id="workers" data-rule="required" data-live-search="true">
{volist name="work" id="vo"}
<option value="{$vo.id}" {if $wid == $vo.id}selected{/if}>{$vo.name}</option>
{/volist}
</select>
2.js
$('#workers').selectpicker('val', "选中值");
$('#workers').selectpicker('refresh'); // 重新刷新
网友评论