【JSP开源代码栏目提醒】:文章导读:在新的一年中,各位网友都进入紧张的学习或是工作阶段。网学会员整理了JSP开源代码-updateNews.jsp的相关内容供大家参考,祝大家在新的一年里工作和学习顺利!
<%@ page contentType="text/html; charset=gb2312" %>
<%@ page import="java.util.List"%>
<%@ page import="java.sql.*"%>
<%@ page import="com.victor.domain.NewsActionForm"%>
<html>
<head>
<title>添加新闻</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"><style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
}
td{
font-size:9pt;
}
.style1 {
color: #FF9900;
font-weight: bold;
}
-->
</style></head>
<script language="JavaScript">
function RgTest(){
if(document.form.newTitle.value==""){
window.alert("请输入新闻标题:");
document.form.newTitle.focus();
return false;
}
if(document.form.newContent.value==""){
window.alert("请输入新闻内容:");
document.form.newContent.focus();
return false;
}
if(document.form.newsType.value==""){
window.alert("请选择类型:");
document.form.newsType.focus();
return false;
}
if(document.form.newsStyle.value==""){
window.alert("请选择详细类型:");
document.form.newsStyle.focus();
return false;
}
return true;
}
</script>
<%List list=(List)request.getAttribute("listNews");
for(int i=0;i<list.size();i++){
NewsActionForm newsAction=(NewsActionForm)list.get(i);
%>
<body>
<table width="568" height="419" border="0" cellpadding="2" cellspacing="1" bgcolor="#052754">
<tr>
<td align="center" valign="top" bgcolor="#FFFFFF">
<span class="style1"><br>
<br>
<br>
修改新闻</span>
<form name="form" method="post" action="updateNewsAction.do?ID=<%=newsAction.getNewID()%>" onSubmit="return RgTest()">
<table width="453" border="0" cellpadding="2" cellspacing="1" bgcolor="#052754">
<tr>
<td width="81" height="24"align="center" bgcolor="#0099cc">新闻标题</td>
<td width="345" bgcolor="#ffffff"><input type="text" name="newTitle" value="<%=newsAction.getNewTitle()%>"></td>
</tr>
<tr>
<td height="185" align="center" bgcolor="#0099cc">新闻内容</td>
<td align="left" valign="top" bgcolor="#ffffff"><textarea name="newContent" cols="50" rows="12"><%=newsAction.getNewContent()%></textarea></td>
</tr>
<tr>
<td width="81"height="24" align="center" bgcolor="#0099cc">类型</td>
<td width="345" bgcolor="#ffffff"><input name="newsType" type="hidden" value="<%=newsAction.getNewsType()%>"><%=newsAction.getNewsType()%></td>
</tr>
<tr>
<td align="center" height="24"bgcolor="#0099cc">详细类别</td>
<td bgcolor="#ffffff"><input name="newsStyle" type="hidden" value="<%=newsAction.getNewsStyle()%>"><%=newsAction.getNewsStyle()%></td>
</tr>
</table>
<br>
<%}%>
<input type="submit" name="Submit2" value="提交">
<input type="reset" name="Submit" value="重置">
</form> </td>
</tr>
</table>
</body>
</html>