onsubmit 没反应 不执行js 求助啊
<SCRIPTlanguage=javascript>functionCheckPost(){if(document.myform.username.value=="")...
<SCRIPT language=javascript>
function CheckPost()
{
if (document.myform.username.value=="")
{
alert("请填写用户名");
document.myform.username.focus();
return false;
}
if (myform.username.value.length<3)
{
alert("用户名不能少于3个字符");
myform.username.focus();
return false;
}
if (myform.password.value=="")
{
alert("请输入密码");
myform.password.focus();
return false;
}
if (myform.password.value.length<6)
{
alert("密码不能少于6位");
myform.password.focus();
return false;
}
if (myform.password.value!=myform.confirm_password.value)
{
alert("两次密码输入不一致");
myform.password.focus();
return false;
}
if (myform.email.value=="")
{
alert("请输入QQ邮箱");
myform.email.focus();
return false;
}
if (myform.extend_field5.value=="")
{
alert("请输入手机号码");
myform.extend_field5.focus();
return false;
}
}
</SCRIPT>
<form action="user.php" method="post" name="myform" onsubmit="return CheckPost();">
<table style="position: relative; left: 632px; top: 12px;">
<tr><td height="25"><input name="username" id="username" class=input type=text size=27>
</td>
</tr>
<tr><td height="25"><input name="password" id="password" class=input type=password size=27></td>
</tr>
<tr><td height="25"><input name="confirm_password" id="confirm_password" class=input type=password size=27></td>
</tr>
<tr><td height="25"><input name="extend_field5" id="extend_field5" class=input type=text size=27></td>
</tr>
<tr><td height="25"><input name="email" id="email" class=input type=text size=27></td>
</tr>
<tr><td height="0"><input type=hidden name=act value=act_register class=input2><input type=hidden name=agreement value=1 class=input2></td>
</tr>
<tr><td><input type=submit class=anniu value="">
<input type="button" name="Submit" onclick="javascript:return CheckPost();" value="开 始 注 册" style="height:30px;">
</td>
</tr>
<tr><td></td>
</tr>
</table>
</form></td> 展开
function CheckPost()
{
if (document.myform.username.value=="")
{
alert("请填写用户名");
document.myform.username.focus();
return false;
}
if (myform.username.value.length<3)
{
alert("用户名不能少于3个字符");
myform.username.focus();
return false;
}
if (myform.password.value=="")
{
alert("请输入密码");
myform.password.focus();
return false;
}
if (myform.password.value.length<6)
{
alert("密码不能少于6位");
myform.password.focus();
return false;
}
if (myform.password.value!=myform.confirm_password.value)
{
alert("两次密码输入不一致");
myform.password.focus();
return false;
}
if (myform.email.value=="")
{
alert("请输入QQ邮箱");
myform.email.focus();
return false;
}
if (myform.extend_field5.value=="")
{
alert("请输入手机号码");
myform.extend_field5.focus();
return false;
}
}
</SCRIPT>
<form action="user.php" method="post" name="myform" onsubmit="return CheckPost();">
<table style="position: relative; left: 632px; top: 12px;">
<tr><td height="25"><input name="username" id="username" class=input type=text size=27>
</td>
</tr>
<tr><td height="25"><input name="password" id="password" class=input type=password size=27></td>
</tr>
<tr><td height="25"><input name="confirm_password" id="confirm_password" class=input type=password size=27></td>
</tr>
<tr><td height="25"><input name="extend_field5" id="extend_field5" class=input type=text size=27></td>
</tr>
<tr><td height="25"><input name="email" id="email" class=input type=text size=27></td>
</tr>
<tr><td height="0"><input type=hidden name=act value=act_register class=input2><input type=hidden name=agreement value=1 class=input2></td>
</tr>
<tr><td><input type=submit class=anniu value="">
<input type="button" name="Submit" onclick="javascript:return CheckPost();" value="开 始 注 册" style="height:30px;">
</td>
</tr>
<tr><td></td>
</tr>
</table>
</form></td> 展开
展开全部
<html>
<head>
<SCRIPT language=javascript>
function CheckPost()
{
if (document.myform.username.value=="")
{
alert("请填写用户名");
document.myform.username.focus();
return false;
}
if (myform.username.value.length<3)
{
alert("用户名不能少于3个字符");
myform.username.focus();
return false;
}
if (myform.password.value=="")
{
alert("请输入密码");
myform.password.focus();
return false;
}
if (myform.password.value.length<6)
{
alert("密码不能少于6位");
myform.password.focus();
return false;
}
if (myform.password.value!=myform.confirm_password.value)
{
alert("两次密码输入不一致");
myform.password.focus();
return false;
}
if (myform.email.value=="")
{
alert("请输入QQ邮箱");
myform.email.focus();
return false;
}
if (myform.extend_field5.value=="")
{
alert("请输入手机号码");
myform.extend_field5.focus();
return false;
}
}
</SCRIPT>
</head>
<body>
<form action="user.php" method="post" name="myform" onsubmit="return CheckPost();">
<table style="position: relative; left: 632px; top: 12px;">
<tr><td height="25"><input name="username" id="username" class=input type=text size=27>
</td>
</tr>
<tr><td height="25"><input name="password" id="password" class=input type=password size=27></td>
</tr>
<tr><td height="25"><input name="confirm_password" id="confirm_password" class=input type=password size=27></td>
</tr>
<tr><td height="25"><input name="extend_field5" id="extend_field5" class=input type=text size=27></td>
</tr>
<tr><td height="25"><input name="email" id="email" class=input type=text size=27></td>
</tr>
<tr><td height="0"><input type=hidden name=act value=act_register class=input2><input type=hidden name=agreement value=1 class=input2></td>
</tr>
<tr><td><input type=submit class=anniu value="">
<input type="button" name="Submit" onclick="javascript:return CheckPost();" value="开 始 注 册" style="height:30px;">
</td>
</tr>
<tr><td></td>
</tr>
</table>
</form>
</body>
</html>
你想要什么反应?
我试了一下,好像还行啊。
微测检测5.10
2023-07-11 广告
2023-07-11 广告
IEC62133与en62133的区别如下:1. 认证机构不同:IEC62133是国际的标准,它以国际通用的标准进行生产;而en62133采用的是欧盟的标准,它使用欧盟的生产需求进行生产。2. 宗旨不同:IEC62133的宗旨是促进电气、电...
点击进入详情页
本回答由微测检测5.10提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询