JavaScript中函数参数的传递问题
<Script Language = "JavaScript">
function mycheck(type){
document.myform.type.value=type;
if(document.myform.username.value=="") {
alert("请输入用户名!");
return;
}
if(document.myform.password.value=="") {
alert("密码不能为空!");
return;
}
else if(document.myform.password.value!=document.myform.password2.value) {
alert("两次输入的密码不一致,请重新输入!");
return;
}
document.myform.submit();
}
</Script>
<Script Language = "JavaScript">
function mycheck(type){
document.myform.type.value=type;
if(document.myform.username.value=="") {
alert("请输入用户名!");
return;
}
if(document.myform.password.value=="") {
alert("密码不能为空!");
return;
}
else if(document.myform.password.value!=document.myform.password2.value) {
alert("两次输入的密码不一致,请重新输入!");
return;
}
document.myform.submit();
}
</Script>