20,359
社区成员
发帖
与我相关
我的任务
分享
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档 </title>
<script type="text/javascript">
<!--
function checkform(form1){
if(form1.num.value==""){
alert("学号不能为空,请输入学号!");
form1.num.focus();
return false;
}
if(form1.name.value==""){
alert("姓名不能为空,请输入姓名!");
form1.name.focus();
return false;
}
if(form1.birthday.value==""){
alert("出生日期不能为空,请输入出生日期!");
form1.birthday.focus();
return false;
}
if(form1.class.value==""){
alert("出生日期不能为空,请输入出生日期!");
return false;
}
}
-->
</script>
</head>
<body>
<form name="form1" action="" method="post" onsubmit="return checkform(this);">
<table align="center" border="0" cellpadding="3">
<caption align="center"> <font color="#FF0000" size="+2" >学生信息录入界面 </font> </caption>
<tr>
<th scope="row">学号: </th> <td> <input type="text" name="num"/> </td>
</tr>
<tr>
<th scope="row">姓名: </th> <td> <input type="text" name="name"/> </td>
</tr>
<tr>
<th scope="row">性别: </th> <td> <input type="radio" name="sex" value="男"/>男 <input type="radio" name="sex" value="女"/>女 </td>
</tr>
<tr>
<th scope="row">出生日期: </th> <td> <input type="text" name="birthday"/> </td>
</tr>
<tr>
<th scope="row">专业: </th>
<td>
<select name="major" size="1">
<option value="0" selected="selected">--请选择-- </option>
<option value="电子信息工程">电子信息工程 </option>
<option value="通信" >通信 </option>
<option value="自动化">自动化 </option>
<option value="电气自动化">电气自动化 </option>
<option value="仪器">仪器 </option>
</select>
</td>
</tr>
<tr>
<th scope="row">班级: </th> <td> <input type="text" name="class"/> </td>
</tr>
<tr>
<th scope="row">是否团员: </th> <td> <input type="checkbox" name="check" value="yes"> </td>
</tr>
<tr>
<th scope="row">电子信箱: </th> <td> <input type="text" name="email"/> </td>
</tr>
<tr>
<td colspan="2" align="center"> <input name="btnsubmit" type="submit" value="提交" />
<input type="reset" name="reset1" value="重置" />
</tr>
<tr> <td colspan="2" align="center"> <font color="red">
</font> </td> </tr>
</table>
</form>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档 </title>
<script type="text/javascript">
<!--
function checkform(){
var form1 = document.form1;
if(form1.num.value==""){
alert("学号不能为空,请输入学号!");
form1.num.focus();
return false;
}
if(form1.name.value==""){
alert("姓名不能为空,请输入姓名!");
form1.name.focus();
return false;
}
if(form1.birthday.value==""){
alert("出生日期不能为空,请输入出生日期!");
form1.birthday.focus();
return false;
}
if(form1.class.value==""){
alert("出生日期不能为空,请输入出生日期!");
return false;
}
return true;
}
-->
</script>
</head>
<body>
<form name="form1" action="" method="post" onsubmit="return checkform()">
<table align="center" border="0" cellpadding="3">
<caption align="center"> <font color="#FF0000" size="+2" face="方正行楷简体">学生信息录入界面 </font> </caption>
<tr>
<th scope="row">学号: </th> <td> <input type="text" name="num"/> </td>
</tr>
<tr>
<th scope="row">姓名: </th> <td> <input type="text" name="name"/> </td>
</tr>
<tr>
<th scope="row">性别: </th> <td> <input type="radio" name="sex" value="男"/>男 <input type="radio" name="sex" value="女"/>女 </td>
</tr>
<tr>
<th scope="row">出生日期: </th> <td> <input type="text" name="birthday"/> </td>
</tr>
<tr>
<th scope="row">专业: </th>
<td>
<select name="major" size="1">
<option value="0" selected="selected">--请选择-- </option>
<option value="电子信息工程">电子信息工程 </option>
<option value="通信" >通信 </option>
<option value="自动化">自动化 </option>
<option value="电气自动化">电气自动化 </option>
<option value="仪器">仪器 </option>
</select>
</td>
</tr>
<tr>
<th scope="row">班级: </th> <td> <input type="text" name="class"/> </td>
</tr>
<tr>
<th scope="row">是否团员: </th> <td> <input type="checkbox" name="check" value="yes"> </td>
</tr>
<tr>
<th scope="row">电子信箱: </th> <td> <input type="text" name="email"/> </td>
</tr>
<tr>
<td colspan="2" align="center"> <input name="btnsubmit" type="submit" value="提交" />
<input type="reset" name="reset1" value="重置" />
</tr>
<tr> <td colspan="2" align="center"> <font color="red">
</font> </td> </tr>
</table>
</form>
</body>
</html>