asp 选择框隐藏问题

来源:百度知道 编辑:UC知道 时间:2024/05/17 10:40:36
<tr>
<td class="td1">线路别</td><td class="td1" width="150"><input name="xlb" type="text" id="xlb" size="14" value=<%=rs("xlb")%> onclick=showSel1(true)>
<br/><select id=qswh1 size=5 style=position:absolute;display:none onchange=selText1(xlb)>
<option>陇海
<option>焦柳
<option>侯月
</select>
<script>
function document.onclick(){
showSel1(false)
}

function showSel1(flag){
document.all.qswh1.style.display=(flag?"block":"none")
window.event.cancelBubble=true;
}

function selText1(obj1){
obj1.value=(document.all.qswh1.options[document.all.qswh1.selectedIndex].text)
showSel1(false)
}
</script>

</tr><t

function document.onclick()
这个函数你重复定义了,所以只有后面声明的函数有效。
把两个调用都放到一个函数里面就行了。
function document.onclick(){
showSel(false)
showSel1(false)
}