方法很多
userPwd = document.form1.userPwd.value;
userPwd2 = document.form1.userPwd2.value;
if (userPwd2 != userPwd)
{
alert("报错");
return false;
}
else
{
location = "xx.asp";
}
userPwd = document.form1.userPwd.value;
userPwd2 = document.form1.userPwd2.value;
if (userPwd2 != userPwd)
{
alert("报错");
return false;
}
else
{
location = "xx.asp";
}
解决方案 »
- actionscript和javascript的escape方法兼容问题
- firefox 下的js问题
- javascript联动菜单的问题
- 用javascript控制超链接
- 点击图片的热点时,图片消失,怎么回事?
- 关于格式化判断!!
- 如何判断文本框输入的是英文还是中文、日文、韩文以及别的语言?
- javascript超难问题。。键盘事件和highlight问题!!
- 打印问题?打印的时候如何不出现:页码,地址如:http://localhost/aa.html等信息?
- 如何在ie5.0下实现打印预览?
- showModalDialog打开的对话框如何可以向另一个网页传值并控制该页面让该值显示出来
- 请教小问题~~
<!--
function checkForm(){
userPwd = document.registerarea.userPwd.value;
userPwd2 = document.registerarea.userPwd2.value;
if (userPwd2 != userPwd)
{
alert("密码不一致。");
return false;
}
}
//-->
</script>
<form name="registerarea" method="post" action="registersub.asp" onSubmit="return checkForm();"><input name="userPwd" type="password">
<input name="userPwd2" type="password">
<input type="submit" name="button" value="确定">
</form>