?? editnews.asp
字號:
<!--#include file="conn.asp"-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>無標題文檔</title>
</head>
<body>
<SCRIPT LANGUAGE="JavaScript">
<!--
function chechform()
{
if(checkspace(document.userinfo.news_title.value)) {
alert("對不起,請填寫新聞標題!");
document.userinfo.news_title.focus();
return false;
}
if(checkspace(document.userinfo.typeid.value)) {
alert("對不起,請選擇所屬類別!");
document.userinfo.typeid.focus();
return false;
}
}
function checkspace(checkstr) {
var str = '';
for(i = 0; i < checkstr.length; i++) {
str = str + ' ';
}
return (str == checkstr);
}
//-->
</script>
<%newsid=trim(Request("newsid"))
set rss=server.createobject("adodb.recordset")
sql="select * From news where newsid="&newsid
rss.open sql,conn,1,1%>
<form name="userinfo" method="post" action="save_news.asp?action=edit&newsid=<%=newsid%>">
<table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolordark="#FFFFFF" bordercolorlight="6699cc">
<tr>
<td height="25" colspan="2" align="center">編輯新聞</td>
</tr>
<tr>
<td width="15%" height="25" align="center">新聞標題:</td>
<td>
<input name="news_title" type="text" size="40" value="<%=rss("news_title")%>">
</td>
</tr>
<tr>
<td height="25" align="center">新聞內容:</td>
<td><INPUT type="hidden" name="news_content" value="<%=server.HTMLEncode(rss("news_content"))%>">
<iframe ID="Editor" name="Editor" src="HtmlEditor/index.html?ID=news_content" frameBorder="0" marginHeight="0" marginWidth="0" scrolling="No" style="height:320px;width:600px"></iframe> </td>
</td>
</tr>
<tr>
<td height="25" align="center">所屬類別:</td>
<td><select name="typeid">
<%sql="select * from newsclass"
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,1,1
if rs.eof and rs.bof then%>
<option value="">暫無類別</option>
<%else
do while not rs.eof%>
<option value="<%=rs("typeid")%>" <%if trim(rs("typeid"))=trim(rss("typeid")) then%>selected<%end if%>><%=rs("news_type")%></option>
<%rs.movenext
loop
end if
rss.close:set rss=nothing%>
</select>
</td>
</tr>
<tr>
<td height="25" colspan="2" align="center"><input type="submit" name="Submit" value="保存" onClick="return chechform();"></td>
</tr>
</table></form>
<%rs.close:set rs=nothing%>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -