我在调用两个编辑器.添加中英文产品内容,但一添就是两条.搞了很久,无法解决.望高手指点

hflulei 2009-08-19 05:57:38
我在调用两个编辑器.添加中英文产品内容,但一添就是两条.搞了N久,无法解决.望高手指点

中文内容:id=content
<textarea name="content" cols="62" rows="20" style="display:none"></textarea>
<iframe id="ewebeditor" src="Editor/ewebeditor.asp?id=content&style=s_red" frameborder="0" scrolling="No" width="585" height="350"></iframe>

英文内容:id=enprocontent
<textarea name="enprocontent" cols="62" rows="20" style="display:none"></textarea>
<iframe id="ewebeditor" src="Editor/ewebeditor.asp?id=enprocontent&style=s_red" frameborder="0" scrolling="No" width="585" height="350"></iframe>



这是表单程序
<!--#include file="include/data.asp"-->
<!--#include file="include/check.asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
</head>

<body>
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1">
<tr align="center" bgcolor="#3F7DBC">
<td width="100%" height="28" colspan="2" class="title">PDF Catalogue信息添加</td>
</tr>
</table>
<table width="100%" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#E8E8E8">
<form action="pdfadd.asp?Action=Add&anclassid=<%=anclassid%>" method="post" name="myform">
<tr>
<td height="28" align="center" bgcolor="#F6F6F6">中文名称:</td>
<td width="88%" colspan="3" bgcolor="#FFFFFF"><input name="proname" type="text" class="input" id="proname" size="40" maxlength="50" />
<span class="red">* </span></td>
</tr>
<tr>
<td height="28" align="center" bgcolor="#F6F6F6">英文名称:</td>
<td colspan="3" bgcolor="#FFFFFF"><input name="enproname" type="text" class="input" id="enproname" size="40" maxlength="50" />
<span class="red">*</span></td>
</tr>
<tr>
<td height="200" align="center" bgcolor="#F6F6F6">中文内容:</td>
<td colspan="3" valign="top" bgcolor="#FFFFFF"><textarea name="content" cols="62" rows="20" style="display:none"></textarea>
</textarea>
<iframe id="ewebeditor" src="../Editor/ewebeditor.asp?id=content&style=s_red" frameborder="0" scrolling="No" width="585" height="350"></iframe></td>
</tr>
<tr>
<td height="200" align="center" bgcolor="#F6F6F6">英文内容:</td>
<td colspan="3" valign="top" bgcolor="#FFFFFF"><textarea name="enprocontent" cols="62" rows="20" style="display:none"></textarea>
<iframe id="ewebeditor" src="../Editor/ewebeditor.asp?id=enprocontent&style=s_red" frameborder="0" scrolling="No" width="585" height="350"></iframe></td>
</tr>
<tr bgcolor="#FFFFFF">
<td colspan="4" align="center" bgcolor="#FFFFFF"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td height="30" align="center" bgcolor="#F6F6F6"><input name="Submits" type="submit" class="input" value="添加PDF" />

<input name="Submits" type="button" class="input" value="返回上页" onclick="javascript:history.back(-1)" /></td>
</tr>
</table></td>
</tr>
</form>
</table>
</body>
</html>



处理程序

if request("proname")="" or isEmpty(request("proname")) then%>
<script language=javascript>alert( "[ 操作提示 ]\n名称未填写,请返回填写名称!");location.href = "javascript:history.back()"</script>
<% ElseIf request("simage")="" or isEmpty(request("image")) Then %>
<script language=javascript>alert( "[ 操作提示 ]\n图片未上传,请返回上传图片!");location.href = "javascript:history.back()"</script>
<% ElseIf request("content")="" or isEmpty(request("content")) Then %>
<script language=javascript>alert( "[ 操作提示 ]\n内容未填写,请返回填写内容!");location.href = "javascript:history.back()"</script>
<% Else
set rs=server.createobject("adodb.recordset")
sql="select top 1 * from pdf"
rs.open sql,conn,1,3
rs.AddNew
rs("proname") = request ("proname")
rs("enproname") = request ("enproname")
rs("procontent") = request("content")
rs("enprocontent") = request("enprocontent")
rs.Update
rs.Close
set rs=nothing
conn.close
set conn=nothing
response.Write("<script language=javascript>alert('[ 操作提示 ]\n\nPDF添加成功!');location.href='pdf.asp'</script>")
end If


以上两段程序.
可去测试看下效果.一加就是两条一样的.
www.jm68.com/test

希望高手解决.感谢感谢再感谢!
...全文
77 10 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
hookee 2009-08-24
  • 打赏
  • 举报
回复
firefox下用firebug测试一下,网络标签下, 看看是不是发送了两次对插入页面的请求.
hflulei 2009-08-23
  • 打赏
  • 举报
回复
处理程序单独写出来也不行。我是各招用尽。才来此求助。尚未解决。急等大家给于答案。
hflulei 2009-08-23
  • 打赏
  • 举报
回复
不可能不重复啊。你添加后。看是不是有两条一样的。注意看下ID,肯定是一添加就产生了两个ID,两条同样的记录。
shihuaxian123 2009-08-20
  • 打赏
  • 举报
回复
楼主我们这里都没有重复,你的怎么回事啊
hezhenyun 2009-08-20
  • 打赏
  • 举报
回复
我也是的
hookee 2009-08-20
  • 打赏
  • 举报
回复
我测试下来没有重复插入
hflulei 2009-08-20
  • 打赏
  • 举报
回复
INSERT也不行.
一楼的意思不是太明白
ilxl520 2009-08-20
  • 打赏
  • 举报
回复
处理程序 里的代码单独写入一个ASP页面里(如save_action.asp),表单提交到save_action.asp

或者
if request("proname")="" or isEmpty(request("proname")) then%>
<script language=javascript>alert( "[ 操作提示 ]\n名称未填写,请返回填写名称!");location.href = "javascript:history.back()" </script>
<% ElseIf request("simage")="" or isEmpty(request("image")) Then %>
<script language=javascript>alert( "[ 操作提示 ]\n图片未上传,请返回上传图片!");location.href = "javascript:history.back()" </script>
<% ElseIf request("content")="" or isEmpty(request("content")) Then %>
<script language=javascript>alert( "[ 操作提示 ]\n内容未填写,请返回填写内容!");location.href = "javascript:history.back()" </script>
<% Else
set rs=server.createobject("adodb.recordset")
sql="select top 1 * from pdf"
rs.open sql,conn,1,3
rs.AddNew
rs("proname") = request ("proname")
rs("enproname") = request ("enproname")
rs("procontent") = request("content")
rs("enprocontent") = request("enprocontent")
rs.Update
rs.Close
set rs=nothing
conn.close
set conn=nothing
response.Write(" <script language=javascript>alert('[ 操作提示 ]\n\nPDF添加成功!');location.href='pdf.asp' </script>")
end If

把这段写到PDF.asp这个页面的最上面(第一行)
sinbasara 2009-08-19
  • 打赏
  • 举报
回复
有没试过INSERT语句?
hookee 2009-08-19
  • 打赏
  • 举报
回复
用 表单程序(无Editor) 和 处理程序的数据库操作部分测试,没有重复添加的情况

内容概要:本文详细介绍了一个基于C++语言开发的疫苗接种和儿童体检系统的设计与实现全过程,涵盖项目背景、目标意义、架构设计、核心功能模块、数据库实现、API接口规范、前后端代码实现及部署应用等多个方面。系统采用分层架构与模块化设计,实现了儿童信息管理、疫苗接种记录、体检数据录入、多用户权限控制、数据统计分析、异常预警、安全加密与日志审计等核心功能,并通过MySQL数据库进行数据持化,结合Qt实现图形化界面,支持高并发、数据脱敏、多平台对接与自动化部署。项目强调数据安全、隐私保护与系统可扩展性,适用于社区医疗、疾控中心、学校及医院等场景。; 适合人群:具备C++编程基础,熟悉数据库操作和基本软件工程流程的开发人员、计算机及相关专业学生、医疗信息化项目开发者,以及希望了解完整医疗管理系统开发流程的技术人员。; 使用场景及目标:①学习如何使用C++构建完整的医疗信息管理系统;②掌握数据库设计、前后端交互、权限控制、多线程处理和GUI开发等关键技术;③应用于社区卫生服务、学校健康管理、疾控数据统计等实际业务场景,提升儿童健康管理水平;④作为课程设计、毕业设计或实际项目的参考模板。; 阅读建议:建议读者结合文档中的代码示例与数据库脚本,搭建本地开发环境进行实践操作,重点关注系统架构设计、模块解耦、安全机制与前后端交互逻辑,深入理解各功能模块的实现原理,并尝试在此基础上进行功能扩展,如接入移动端或增加AI分析模块。

28,409

社区成员

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

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