怎样在加载完jsp页面后,下拉框的值从数据库中读取 5
js中的代码functionaudit(){varaudit=document.getElementById("audits");varselectIndex=audit...
js中的代码
function audit(){
var audit=document.getElementById("audits");
var selectIndex = audit.selectedIndex;
var selectText = audit.options[selectIndex].text;
var divs = document.getElementsByTagName( "DIV");
//alert(document.getElementsByName(audit.value)[0].title);
for(var i=0;i<divs.length;i++){
if(divs[i].id==audit.value){
alert("已经选中该选项!");
return;
}
}
AddElement(audit.value,selectText);
}
jsp中的代码
<table class="bluebkg" width="100%" align="left">
<tr>
<td align="left">
<select id='audits' name="audits" sine="15" style="WIDTH:140px" tabindex="12">
</select>
<input align="left" type="button" id="addaudit" value="添加审核人" onclick="audit();">
</td>
<td align="left"></td>
</tr>
</table> 展开
function audit(){
var audit=document.getElementById("audits");
var selectIndex = audit.selectedIndex;
var selectText = audit.options[selectIndex].text;
var divs = document.getElementsByTagName( "DIV");
//alert(document.getElementsByName(audit.value)[0].title);
for(var i=0;i<divs.length;i++){
if(divs[i].id==audit.value){
alert("已经选中该选项!");
return;
}
}
AddElement(audit.value,selectText);
}
jsp中的代码
<table class="bluebkg" width="100%" align="left">
<tr>
<td align="left">
<select id='audits' name="audits" sine="15" style="WIDTH:140px" tabindex="12">
</select>
<input align="left" type="button" id="addaudit" value="添加审核人" onclick="audit();">
</td>
<td align="left"></td>
</tr>
</table> 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询