//JS
<script type="text/javascript>
//ajax动态给添加原料的【商品名称】下拉框绑定selected属性
$("#origin_code").find("option").each(function(index,dom){
if($(this).val() == msg.data.origin_code){
$(this).attr("selected","selected");
return false;
}
}) </script>
//html
<select name="ajax[origin_code2]" id="origin_code" class="form-control" >
<option value="">请选择原料名称</option>
<volist name="origin_arr" id="vo">
<option value="{$vo.origin_code}" ref="{$vo.origin_unit}" >{$vo.origin_name}</option>
</volist>
</select>