//获取下拉列表框的值
function getDue(selectId,id){
var dueTo=selectId.options[selectId.selectedIndex].text;
if(dueTo==null || dueTo==""){
return false;
}
document.getElementById(id).value=dueTo;
//alert(dueTo);
return true;
}
function checkdispath(){
var dispath=document.getElementById("item.chcDueId").value;
if(dispath=="0"){
alert('请选择指派项');
return;
}
document.forms[0].submit();
}
function helps(){
alert('抱歉!暂无帮助');
}
---------------------------------------
<html:select property="item.chcDueId" onchange="getDue(this,'item.chcDueTo')">
<html:option value="0">===请选择===</html:option>
<html:optionsCollection name="kehu" label="usrName"
value="usrId" />
</html:select>
本文介绍了一种使用JavaScript来获取HTML中下拉列表选中值的方法,并展示了如何在用户选择后提交表单。此外,还提供了一个简单的帮助功能提示。
275

被折叠的 条评论
为什么被折叠?



