站内搜索: 请输入搜索关键词

当前页面: 开发资料首页JSP 专题请各位帮我看看哪里有问题!运行没有错误,可是就是不显示结果!(急死了!)

请各位帮我看看哪里有问题!运行没有错误,可是就是不显示结果!(急死了!)

摘要: 请各位帮我看看哪里有问题!运行没有错误,可是就是不显示结果!(急死了!)


<script LANGUAGE=JavaScript>
function hide(var s) {
document.getElementById(s).style.display = "none";
}
function show(var s) {
document.getElementById(s).style.display = "block";
}
</script>
。。。
<select class=input name='s1' id='s1'>
<option value="1" onClick="hide('flight5');show('flight4');">按航班号</option>
<option value="2" onClick="hide('flight4');show('flight5');">按城市</option>
</select>
。。。

<table width="100%">
。。。
</table>


<table width="100%">
。。。
</table>

我是想实现当选择“按航班号”时显示“flight4”,选择“按城市”时,显示“flight5”。



用一个层去实现


whzresponse() :您能说明白点么?


select 的 option项没有onclick函数,而是select本身有onchange函数 这一点你要明白



object.style.visibility="visible" or "hidden"
来替换object.style.display = "none" or "block"
就可以实现你要求的效果.我就是这样实现的




<script language=JavaScript>
function hide(s) {

document.getElementById(s).style.display = "none";

}
function show(s) {
document.getElementById(s).style.display = "block";
}
function changeValue(value1){

if(parseInt(value1)==1){
hide('flight5');
show('flight4');
}else if(parseInt(value1)==2){
hide('flight4');
show('flight5');
}

}
</script>

<head></head>
<body>
<select name='s1' id='s1' onchange="changeValue(this.options[selectedIndex].value)">
<option value="1" >按航班号</option>
<option value="2" >按城市</option>
</select>

<table width="100%">


</table>


<table width="100%">

</table>

</body>



谢谢各位!


↑返回目录
前一篇: 关于Hibernate的问题,请各位帮忙看看!!!!
后一篇: 调查:各位用哪种方式开发JSP?嵌入式的脚本OR指令(用标记库JSTL)?