菜鸟的求救!!!!

mywjh 2003-08-20 04:03:48
该段代码是添加文章内容的文本框,但在文本框中不能粘贴word表格,请求各位高手能给予改写






<!--#include file="admin_head.asp"-->
<br><br>
<%
if request("method") = 1 then
if Request("Classid") = "" or Request("Nclassid") = "" then
Errmsg = "<li>请选择文章所属的大栏目及小栏目。"
FoundErr = true
else
Classid = Request("Classid")
Nclassid = Request("Nclassid")
end if
if Trim(Request.Form("title")) = "" then
Errmsg = Errmsg + "<li>请输入文章标题。"
FoundErr = true
else
Title = Qcdn.checkStr(Trim(Request.Form("title")))
end if

if Trim(Request.Form("content")) = "" then
Errmsg = Errmsg + "<li>请输入文章内容。"
FoundErr = true
else
Content = Qcdn.checkStr(Trim(Request.Form("content")))
end if
if Trim(Request.Form("nkey")) = "" then
Errmsg = Errmsg + "<li>请输入相关文章。"
FoundErr = true
else
nkey = Qcdn.checkStr(Trim(Request.Form("nkey")))
end if
if FoundErr then
Call Qcdn.Err_List(Errmsg,1)
Response.End()
end if
Intime = Request("year1") & "-" & Request("month1") & "-" & Request("day1")
writer = Qcdn.checkStr(Trim(Request.Form("writer")))
writefrom = Qcdn.checkStr(Trim(Request.Form("writefrom")))
Sql = "Insert into article_info(content,title,nclassid,classid,nkey,Intime,writer,writefrom,author,flag)values('"& content &"','"
Sql = Sql & title & "',"& nclassid &","& classid &",'"& nkey &"','"& Intime &"','"& writer &"','"& writefrom &"','"& Session("Admin_Name") &"',0)"
Conn.execute(Sql)
Response.Write("<script>alert(""添加成功"");location.href=""admin_addnews.asp"";</script>")
Response.End()
end if
set rs = conn.execute("select * from article_class where flag <>0 order by Unid asc")
%>
<script language = "JavaScript">
var onecount;
onecount=0;
subcat = new Array();
<%
count = 0
do while not rs.eof
%>
subcat[<%=count%>] = new Array("<%=Qcdn.HTMLcode(rs(1))%>","<%=rs(2)%>","<%=rs(0)%>");
<%
count = count + 1
rs.movenext
loop
rs.close
%>
onecount=<%=count%>;

function changelocation(locationid)
{
document.form1.Nclassid.length = 0;

var locationid=locationid;
var i;
for (i=0;i < onecount; i++)
{
if (subcat[i][1] == locationid)
{
document.form1.Nclassid.options[document.form1.Nclassid.length] = new Option(subcat[i][0], subcat[i][2]);
}
}

}
</script>
<script src="inc/forms.js"></script>
<table width="95%" border="1" cellspacing="0" cellpadding="3" align="center" bordercolorlight="#ECEEE4" bordercolordark="#CCCABC">
<form action="" name="form1" method="post">
<tr>
<td colspan="2" align="center" height="30" background="image/tablebg.gif"><b>添
加 文 章 内 容 </b> </td>
</tr>
<tr valign="middle">
<td width="15%" height="25">栏目选择:</td>
<td width="85%" height="25">
<%
set rs = conn.execute("select Unid,classname from article_class where flag = 0 order by Unid asc")
if rs.eof and rs.bof then
response.write "请先添加栏目。"
response.end
else
%>
<select name="classid" onChange="changelocation(document.form1.classid.options[document.form1.classid.selectedIndex].value)" size="1">
<option value="">选择栏目</option>
<%do while not rs.eof%>
<option value="<%=rs(0)%>"><%=Qcdn.HTMLcode(rs(1))%></option>
<%
rs.movenext
loop
end if
rs.close
set rs = nothing
%>
</select>
 
<select name="Nclassid">
<option value="">选择栏目</option>
</select> <font color="red">*</font></td>
</tr>
<tr valign="middle">
<td height="25">文章标题:</td>
<td height="25"> <input name="title" type="text" size="70" maxlength="50"> <font color="red">*</font>
</td>
</tr>
<tr valign="middle">
<td height="25">快捷标签:</td>
<td height="25"><!--#include file="admin_getubb.asp"--></td>
</tr>
<tr valign="middle">
<td height="25">上传图片:</td>
<td height="25">
<iframe name="ad" src="admin_upload.asp" width="300" height="25" frameborder=0 scrolling=no></iframe>
</td>
</tr>
<tr valign="middle">
<td height="25">发布日期:</td>
<td height="25"> <select name="year1">
<option value="<%=year(Now())%>" selected><%=year(Now())%></option>
<%
for i=2001 to 2005
response.write "<option value='"&i&"'>"&i&"</option>"
next
%>
</select>

<select name="month1">
<option value="<%=month(Now())%>" selected><%=month(Now())%></option>
<%
for i=1 to 12
response.write "<option value='"&i&"'>"&i&"</option>"
next
%>
</select>

<select name="day1">
<option value="<%=day(Now())%>" selected><%=day(Now())%></option>
<%
for i=1 to 31
response.write "<option value='"&i&"'>"&i&"</option>"
next
%>
</select>
日</td>
</tr>
<tr valign="middle">
<td height="25">文章内容:</td>
<td height="25"><textarea name="content" cols="70" rows="15" id="content" style="font-size:14px"></textarea> <font color="red">*</font></td>
</tr>
<tr valign="middle">
<td height="25">相关文章:</td>
<td height="25"><input name="nkey" type="text" id="nkey" size="50" maxlength="50">
<select name="select" onchange=Dokey(this.options[this.selectedIndex].value)>
<option value="" selected></option>
<%Call Qcdn.OptionList(1)%>
</select> <font color="red">*</font></td>
</tr>
<tr valign="middle">
<td height="25">作    者:</td>
<td height="25"><input name="writer" type="text" id="writer" size="50" maxlength="50">
<select name="select2" onChange=Dowriter(this.options[this.selectedIndex].value)>
<option value="" selected></option>
<%Call Qcdn.OptionList(2)%>
</select> </td>
</tr>
<tr valign="middle">
<td height="25">来    源:</td>
<td height="25"><input name="writefrom" type="text" id="writefrom" size="50" maxlength="50">
<select name="select3" onChange=Dowritefrom(this.options[this.selectedIndex].value)>
<option value="" selected></option>
<%Call Qcdn.OptionList(3)%>
</select> </td>
</tr>
<tr>
<td height="25" colspan="2" align="center"> <input type="submit" name="Submit" value=" 提 交 " class="tbutton">
<input type="reset" name="Submit2" value=" 重 置 " class="tbutton"> </td>
</tr>
<input type="hidden" name="method" value="1">
</form>
</table>
<!--#include file="admin_copy.asp"-->








...全文
59 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
mywjh 2003-08-20
  • 打赏
  • 举报
回复
请问有什么样的好的组件
Brookes 2003-08-20
  • 打赏
  • 举报
回复
有些一厢情愿了,本来文本框中就不能贴word之类带格式的内容。
除非你使用组件,网上找找
csdntoll 2003-08-20
  • 打赏
  • 举报
回复
用CSDN的试试:

http://www.csdn.net/Develop/Add_Article.asp
sunyc 2003-08-20
  • 打赏
  • 举报
回复
本来就不能粘贴word东西的。不兼容的。搞笑了。
业余程序员 2003-08-20
  • 打赏
  • 举报
回复
楼上的兄弟好毒啊~~~
82yuxuan 2003-08-20
  • 打赏
  • 举报
回复
直接在BODY中把鼠标给屏蔽掉!这样就不能选择了

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
    加入社区
    • 近7日
    • 近30日
    • 至今
    社区公告
    暂无公告

    试试用AI创作助手写篇文章吧