js实现
ses = document.getElementById("<%=dropDownlist1.ClientID%>")
for(i = 0;i<ses.options.length;i++)
{
if(ses.options[i].value=="你的id") ses.options[i].selected=true
}

解决方案 »

  1.   

    <html:select property="enable">
    <html:option value="1">accountForm.Activate </option >
    <html:option value="0">accountForm.Inactivate<option />
    </html:select>
    这样看看吧!
      

  2.   

    找到一个解决办法,但是有点麻烦。
    1.定义一个隐藏变量enablehid,它的值也是从DB中取出的值。
    <html:hidden property="enablehid">
    <html:select property="enable">
    <html:option value="1" key="accountForm.Activate" />
    <html:option value="0" key="accountForm.Inactivate"/>
    </html:select>2.
    <body onLoad= "selInit()" >3.
    <script language=javascript>
    function selInit(){
    document.getElementById(enable).value=document.getElementById(enablehid).value;
    }</script>