?? student_update1.jsp
字號:
<%@ page contentType="text/html;charset=GB2312" %>
<%@ page import="java.sql.ResultSet,util.commonTag"%>
<html>
<!------系統(tǒng)交互javascript----->
<script language="JavaScript">
<!--
function check_data() {
//按提交按鈕時,檢查數(shù)據(jù)是否為空
if(update_student_form.class_id.value==0){
alert("請選擇學生所屬班級!");
return false;
}
if(update_student_form.studentname.value.length==0){
alert("輸入的學生姓名為空,請重新輸入!");
return false;
}else return true;
}
-->
</script>
<%//-------接收student_id,接收class_id參數(shù)參數(shù)------------
int student_id=0;
int class_id=0;
try{
student_id=Integer.parseInt(request.getParameter("student_id"));
class_id=Integer.parseInt(request.getParameter("class_id"));
}catch(Exception e)
{}
%>
<!----聲明JavaBean,并查詢出數(shù)據(jù)---->
<jsp:useBean id="student_select" class="studentman.student_operation" scope="page"/>
<%ResultSet rs=student_select.student_select_one(student_id);%>
<body bgcolor="#DCDADA">
<!---------導航菜單------------->
<jsp:include page="navigator.txt"/>
<%if(rs.next()){%>
<!---------數(shù)據(jù)輸入------------->
<table border="1" width="100%" cellspacing="0" cellpadding="0" bordercolor="#808080" bordercolorlight="#808080" bordercolordark="#808080">
<tr>
<td width="100%">
<table border="0" width="103%">
<tr>
<td width="100%" colspan="5">修改學生信息:<br><hr></td>
</tr>
<form name="update_student_form" action="student_update2.jsp" method="post" onsubmit="return check_data()">
<tr>
<td width="30%" align="right">學生序號:<%=rs.getLong("student_id")%> 所屬班級:</td>
<input type="hidden" value="<%=rs.getLong("student_id")%>" name="student_id">
<td width="20%">
<%//-----生成學生所屬班級下拉框------
commonTag classtag=new commonTag();
out.println(classtag.getClassTag(class_id));
%>
</td>
<td width="10%" align="right">學生姓名:</td>
<td width="20%"><input type="text" name="student_name" value="<%=rs.getString("student_name")%>" maxlength="20"></td>
<td width="20%"><input type="submit" value="提交"></td>
</tr>
</form>
</table>
</td>
</tr>
</table>
<%}%>
<br>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -