|
<td width="175px" align="left"> <span id="sspan" onmousemove="this.setCapture();" onmouseout="this.releaseCapture();" onfocus="this.blur();"> <s:select id="proname" name="design.proname" list="project" listKey="proname" listValue="proname" headerKey="0" headerValue="--請選擇項目--" cssStyle="width:175px"> </s:select> </span> </td> 第一種方法:在js中為select添加一個option并設(shè)為selected $("<option value='"+proval+"' selected>"+proval+"</option>").appendTo("#proname")//添加下拉框的option 第二種方法:在struts2標簽后加value屬性差設(shè)置值 <s:select id="proname" name="design.proname" list="project" listKey="proname" listValue="proname" headerKey="0" headerValue="--請選擇項目--" cssStyle="width:175px" value="%{folProject.state}"> |
|
|