form = document.formname;
if(! /^\w+$/.test(form.userid.value))
alert("userid 非法");
if(! /^\w+$/.test(form.password.value))
alert("password 非法");
if(! /^\w+$/.test(form.userid.value))
alert("userid 非法");
if(! /^\w+$/.test(form.password.value))
alert("password 非法");
能解释一下吗?都说的是什么意思?我没有理解
echo "<table width=200 valign=top>";echo "<tr><td width=100% valign=top>";
echo "<form name=form1 method=post action=cl.php>";echo "<table width=100% valign=top cellspacing=2>";
echo "<tr><td height=20 background=img/dh1.gif align=center><span class=bz>...:::</span> 用户登陆 <span class=bz>:::...</span></td></tr>";
echo "<tr><td bgcolor=#8BA677>";echo "<table width=100% valign=top>";echo "<br><tr><td width=40% height=30 align=center>用户名:</td>";
echo "<td width=60% height=30 align=left><input name=userid type=text size=10></td></tr>";echo "<tr><td width=40% height=30 align=center>口 令:</td>";
echo "<td width=60% height=30 align=left><input name=password type=text size=10></td></tr>";echo "<table width=100%><tr><td height=50 align=center>";
echo"<input type=submit name=submdl value=登陆> ";
echo" <input type=submit name=submzc value=注册>";
echo "</td></tr></table>";
echo "</form></td></tr></table>";?>
在PHP里不能嵌JS吗?
小弟才刚开始学,别笑我,望各位前辈指点一二,小弟不胜感激!!!
if (formct.userid.value=='' || formct.password.value==''){
alert('会员名或密码为空,请填写');
return false;
}
if (/^[^a-z]$/g.test(formct.userid.value)){
alert("userid 非法");
return false;
}
if (/^[^a-zA-Z0-9]$/g.test(formct.password.value)){
alert("password 非法");
return false;
}
}
if (formct.userid.value=='' || formct.password.value==''){
alert('会员名或密码为空,请填写');
return false;
}
if (/^[^a-z]$/g.test(formct.userid.value)){
alert("userid 非法");
return false;
}
if (/^[^a-zA-Z0-9]$/g.test(formct.password.value)){
alert("password 非法");
return false;
}
}