关于设置<select/>标签显示指定的值的问题
eos5.3中的代码:
<select id="select" name="FEE_NJH/FEE_YEAR/criteria/value" size="1">
<option value="">--请选择--</option>
<%for(int i=2006;i<=2019;i++){%>
<option value="<%=i%>"><%=i%></option>
<%}%>
</select>
<script>
var value = "<bean:write property='FEE_NJH/FEE_YEAR/criteria/value'/>";
var select = document.getElementById("select");
var options = select.options;
for(var i=0;i<options.length;i++){
var val = options[i].value;
if(value==val){
document.getElementById("select").options[i].selected = "selected";
}
}
</script>