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
}
ses = document.getElementById("<%=dropDownlist1.ClientID%>")
for(i = 0;i<ses.options.length;i++)
{
if(ses.options[i].value=="你的id") ses.options[i].selected=true
}
解决方案 »
- spring配置文件求助
- eclipse 开发 web 应用与tomcat 6.0的问题
- ssh里面使用dwr,用事务就报错object is not aninstance of declaring class
- 急求,打包tomcat工程问题!
- jsp HElp 急........
- hibernate 用list映射时,要什么条件?
- 急求oc4j
- struts2关于拦截器的配置问题
- 请各位高手看过来,特别是在职的,小弟有急事请教。
- 在线等!请问在hibernate中如何写视图的配置文件?即id怎么对应??
- 面试题(视频传输 )...高手进.来者有分...不够再加...
- 请教了快100个网友了都不会,怎么办
<html:option value="1">accountForm.Activate </option >
<html:option value="0">accountForm.Inactivate<option />
</html:select>
这样看看吧!
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>