js输入框条件判断进入相应的页面问题!
就是有一个输入框,输入相应的条件提交就弹出相应的页面!
如输入1就弹出1的页面!
没有就提示没有找到页面!
高手HELP!
问题点数:20、回复次数:5Top
1 楼andymu077(明治佐玛戒--秀曼)回复于 2005-07-25 13:59:01 得分 20
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Untitled</title>
<Script language="javascript">
function fncTest()
{
var temp=document.all.txt.value;
switch (temp) {
case "a":
window.location.href="a.html"
break;
case "b":
window.location.href="b.html"
break;
case "c":
window.location.href="c.html"
break;
default:
alert("No Page");
break;
}
}
</Script>
</head>
<body>
<input type="text" value="" name="txt">
<input type="button" value="ok" name="btn" onclick="fncTest()">
</body>
</html>
//是这样的吗?Top
2 楼etononline(瑞金 www.rj163.com)回复于 2005-07-25 17:00:51 得分 0
是的,能不能做到是一个弹出窗口,如窗口大小400,300!Top
3 楼andymu077(明治佐玛戒--秀曼)回复于 2005-07-25 17:20:20 得分 0
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Untitled</title>
<Script language="javascript">
function fncTest()
{
var temp=document.all.txt.value;
switch (temp) {
case "a":
window.open("a.html","a",width="300",height="400");
break;
case "b":
window.open("b.html","b",width="300",height="400");
break;
case "c":
window.open("c.html","c",width="300",height="400");
break;
default:
alert("No Page");
break;
}
}
</Script>
</head>
<body>
<input type="text" value="" name="txt">
<input type="button" value="ok" name="btn" onclick="fncTest()">
</body>
</html>
//这样?Top
4 楼andymu077(明治佐玛戒--秀曼)回复于 2005-07-25 17:22:37 得分 0
大小写反了吧?是不是应该是:width="400" height="300"呀?Top
5 楼etononline(瑞金 www.rj163.com)回复于 2005-07-26 11:06:26 得分 0
ok,以搞定!!Top




