看你的代码应该是表单的验证: 表单的验证一般这样写:<form action=index.asp onsubmit="return e()"><script>
function e()
{
if(document.form1.old_ps.value="")
{
alert('请先输入原来的密码,再作更改操作!!');
return false; //返回 false 则表单不会被提交
}
return true; //返回 true 则提交表单
}
</script>
function e()
{
if(document.form1.old_ps.value="")
{
alert('请先输入原来的密码,再作更改操作!!');
return false; //返回 false 则表单不会被提交
}
return true; //返回 true 则提交表单
}
</script>
return 就跳出函数的执行了。
onclick="ttt();"ttt()
{
if not e()
{ return false;}
action:="aaa.asp";
}
{
if(document.form1.old_ps.value="") {
alert('请先输入原来的密码,再作更改操作!!');
}
else
action=“aaa.asp”
}
}
onclick="e">
帮看看这样写对吗?
{
if(document.form1.old_ps.value="") {
alert('请先输入原来的密码,再作更改操作!!');
}
else
action=“aaa.asp”
}
}
<onclick="e()">
帮看看这样写对吗?