<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>A simple HTML sample</title>
<style>
td {text-align:center}
</style>
<script type="text/javascript">
function aa(){
if(f1.name.value==""){
alert("Please input your name!");
f1.name.focus();
return false;
}
if(f1.password.value==""){
alert("Please input your password!");
f1.password.focus();
return false;
}
if(f1.password_again.value==""){
alert("Please input your password again!");
f1.password_again.focus();
return false;
}
if(f1.tel.value==""){
alert("Please input your telphone!");
f1.tel.focus();
return false;
}
if(f1.email.value==""){
alert("Please input your E-mail!");
f1.email.focus();
return false;
}
if(f1.self_introduction.value==""){
alert("Please input your self introduction!");
f1.self_introduction.focus();
return false;
}
return true;
}
</script>
</head>
<body>
<form name="f1" action="2.jsp" method="post" onsubmit="return aa()">
<table width="50%" border="1"/>
<tr><th colspan="2">Register</th></tr>
<tr><td>Name</td><td><input type="text" name="name"></td></tr>
<tr><td>Password</td><td><input type="password" name="password"></td></tr>
<tr><td>Password Again</td><td><input type="password" name="password_again"></td></tr>
<tr><td>Sex</td>
<td><input type="radio" name="sex" value="male" checked>male
<input type="radio" name="sex" value="female">female</td></tr>
<tr><td>Occupation</td>
<td><select size="1" name="Occupation">
<option value="Doctor">Doctor</option>
<option value="Teacher">Teacher</option>
<option value="Lawyer">Lawyer</option></select></td></tr>
<tr><td>Tel</td><td><input type="text" name="tel"></td></tr>
<tr><td>E-mail</td><td><input type="text" name="email"></td></tr>
<tr><td>Hobbies</td>
<td><input type="checkbox" name="reading" value="reading">reading
<input type="checkbox" name="boxing" value="boxing">boxing
<input type="checkbox" name="swimming" value="swimming">swimming
<input type="checkbox" name="photographing" value="photographing">photographing</tr>
<tr><td>Self introduction</td><td><textarea name="self_introduction" rows="5" cols="80"></textarea></td></tr>
<tr><td colspan="2"><input type="reset" value="Reset"><input type="Submit" value="Submit"></td></tr>
</form>
</body>
</html>
简单的Html和JavaScript:用户注册页面
最新推荐文章于 2024-10-31 07:53:07 发布