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

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

希望高手解决.感谢感谢再感谢!
...全文
74 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) 和 处理程序的数据库操作部分测试,没有重复添加的情况

Visual Studio Code 是由微软开发的一款免费、开源、跨平台的现代化轻量级代码编辑器,自发布以来迅速成为全球开发者最受欢迎的工具之一。它结合了编辑器的轻便性和集成开发环境(IDE)的强大功能,支持多种编程语言和开发场景,核心特点: 1. 跨平台支持 可在 Windows、macOS 和 Linux 上运行,保持一致的用户体验。 2. 轻量级与高性能 启动速度快,占用资源少,适合处理大型项目或低配置设备。 3. 智能代码补全 内置 IntelliSense(智能感知),提供代码提示、参数信息、快速修复等功能,支持 JavaScript、TypeScript、Python、C++ 等主流语言。 4. 内置终端 直接在编辑器内打开集成终端(支持 PowerShell、CMD、Bash 等),方便执行命令行操作。 5. 调试工具 内置调试器,支持断点、变量监视、调用堆栈查看等,无需离开编辑器即可调试代码。 6. Git 集成 直接通过侧边栏管理 Git 仓库,支持提交、分支切换、冲突解决等操作。 7. 丰富的扩展生态系统 通过 Extensions Marketplace 可安装数千款插件,扩展功能包括: 语言支持:如 Java、Go、Rust 等。 主题与图标:自定义界面风格。 工具集成:如 Docker、Kubernetes、数据库连接等。 效率工具:如 REST Client、Live Server 等。 8. 自定义与主题 支持修改键盘快捷键、界面主题、文件图标等,打造个性化开发环境。 9. 多光标编辑 按住 Alt(Windows/Linux)或 Option(macOS)点击可添加多个光标,同时编辑多处代码。 10. 远程开发支持 通过 Remote - SSH、Remote - Containers 等扩展,可直接连接远程服务器或开发容器,实现无缝协作。

28,409

社区成员

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

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