?? student_edit.jsp
字號:
<%@ page contentType="text/html;charset=GB2312" %>
<%@ page import="student.dao.*" %>
<%
String path = request.getContextPath();
StudentInfo student=(StudentInfo)request.getAttribute("student");
request.removeAttribute("student");
%>
<html>
<head>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<SCRIPT src="<%=path%>/js/datacheck.js" type=text/javascript></SCRIPT>
</head>
<body>
<center>
<form name="frm" method="post" >
<input type="hidden" name="key" value="<%=student.getId() %>">
<table border=1>
<tr><td colspan="2">學生信息錄入頁面</td></tr>
<tr><td>學號*</td><td><%=student.getId()%></td></tr>
<tr><td>姓名*</td><td><input type="text" name="name" value="<%=student.getName() %>"></td></tr>
<tr><td>數學成績*</td><td><input type="text" name="math" value="<%=student.getMath() %>"></td></tr>
<tr><td>英語成績*</td><td><input type="text" name="english" value="<%=student.getEnglish() %>"></td></tr>
<tr><td>物理成績*</td><td><input type="text" name="physic" value="<%=student.getPhysic() %>"></td></tr>
<tr><td colspan="2" align="center"><input type="button" value="提交" onclick="check();"></td></tr>
</table>
</form>
</center>
</body>
</html>
<script language="JavaScript">
function check(){
if(Trim(frm.name.value)==""){
alert("姓名不能為空!");
frm.name.focus();
return;
}else{
frm.name.value=Trim(frm.name.value);
}
var math=Trim(frm.math.value);
frm.math.value=math;
if(!NumberCheck(math)){
alert("數學成績必須是數值!");
frm.math.focus();
return;
}
var english=Trim(frm.english.value);
frm.english.value=english;
if(!NumberCheck(english)){
alert("英語成績必須是數值!");
frm.english.focus();
return;
}
var physic=Trim(frm.physic.value);
frm.physic.value=physic;
if(!NumberCheck(physic)){
alert("物理成績必須是數值!");
frm.physic.focus();
return;
}
frm.action="<%=path%>/servlet/EditAction";
frm.submit();
}
</script>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -