用javascript 判断用户是否可以到下一个业面

来源:百度知道 编辑:UC知道 时间:2024/09/20 02:44:38
当我输入完密码,拥护。
*点了提交
<html>
<head>
<title>无标题文档</title>
*
*<script>
*
*</script>
*
</head>

<body>
<form id="form1" name="form1" method="post" action="D:\b.jsp" >
<p>
<label>
<input name="txt1" type="text" id="txt1" />
</label>
</p>
<p>
<label>
<input name="txt2" type="password" id="txt2" />
</label>
</p>
<p>
<label>
<input type="submit" name="Submit" value="提交" >
</label>
</p>
</form>
</body>
</html>

<form id="form1" onsubmit="checkform()"

然后增加js代码
function checkform(){
// 你去判断吧,比如
if(document.getElementById("txt1").value==""){
alert("Please input txt1");
return false;
}
}