为什么选中下拉列表的值,显示页面无法显示
在一个界面上,我要通过选择下拉列表的值,再在编辑框内输入对应的值查询。可是为什么我选中下拉列表的值,界面就跳了,便显示说页面无法显示。我将页面后退,选中的值固定了,可以输入查询了。有办法解决页面无法显示吗?将这步骤消去。
------解决方案-------------------- <script language= "JavaScript " type= "text/javascript ">
<!--
function chk()
{
var sform = document.form1;
if(sform.field.selectedIndex==0)
{
alert( "Pls select field! ");
return;
}
if(sform.oprater.selectedIndex==0)
{
alert( "Pls select oprater ");
return;
}
if(sform.sValue.value== " ")
{
alert( "Pls input value ");
return;
}
sform.action= "test.asp ";
sform.submit();
}
//-->
</script>
</head>
<body>
<form name= "form1 " method= "post ">
<select name= "field ">
<option value= " "> Pls Select </option>
<option value= "ID "> ID </option>
<option value= "Title "> Title </option>
</select>
<select name= "oprater ">
<option value= " "> Pls Select </option>
<option value= "= "> = </option>
<option value= "> "> > </option>
<option value= " < "> < </option>
<option value= "like "> like </option>
</select>
<input type= "text " name= "sValue ">
<input type= "button " value= " Search " onclick= "chk(); ">
</form>
</body>
------解决方案-------------------- <td width= "150 "align= "right "> 选择查询条件: </td>
<td width= "50 " align= "left "> <select id= "b1 " name= "b1 " onchange= "window.location.href= '1.aspx?id= '+this.options[this.selectedIndex].value ">
<option value= "TeaID "> 编号 </option>
<option value= "Teaname "> 姓名 </option>
<option value= "Schname "> 学院 </option>
<option value= "Subname "> 专业 </option>
看好了。把
onchange= "window.location.href= '1.aspx?id= '+this.options[this.selectedIndex].value "
这个去掉就行了!