在线编辑ewebeditor

eWebEditor的调用是非常简单,基本上只是在原来的使用中加入一行代码。

标准调用:

<iframe ID="eWebEditor1" src="/ewebeditor.asp?id=content1&style=standard" frameborder="0" scrolling="no" width="500" HEIGHT="350"></iframe>
参数说明:
/ewebeditor.asp应改为你实际安装的路径
参数id:相关联的表单项名,也就是提交保存页要引用的表单项名,多个调用时,请保证id不同,可参见后面例子
参数style:使用的样式名,可以是标准的样式名或自定义的样式名,如果使用标准standard可留空
width,height:根据实际需要设置,eWebEditor将自动调整与其适应
在后台管理中,可以得到每个样式的最佳调用代码
所有入口参数:(即:eWebEditor.asp?后面的参数)
id:相关联的保存编辑内容的表单项名,也就是提交保存页要引用的表单项名
style:使用的样式名,可以是标准的样式名或自定义的样式名,如果使用标准standard可留空
originalfilename:相关联的保存上传原文件名列表的表单项名,必须是input类型,可以带onchange事件[例子]
savefilename:相关联的保存上传保存文件名列表的表单项名,必须是input类型,可以带onchange事件[例子]
savepathfilename:相关联的保存上传保存文件名(带路径)列表的表单项名,必须是input类型,可以带onchange事件[例子]
例子:新增表单

你原来可能是:

<textarea name="content1" rows=10 cols=50></textarea>
现在是:

<input type="hidden" name="content1" value="">
<iframe ID="eWebEditor1" src="/ewebeditor.asp?id=content1&style=standard" frameborder="0" scrolling="no" width="500" HEIGHT="350"></iframe>
或者
<textarea name="content1" style="display:none"></textarea>
<iframe ID="eWebEditor1" src="/ewebeditor.asp?id=content1&style=standard" frameborder="0" scrolling="no" width="500" HEIGHT="350"></iframe>
例子:修改表单

你原来可能是:

<textarea name="content1" rows=10 cols=50><%=Server.HTMLEncode(oRs("D_Content"))%></textarea>

现在是:
请问各位有谁用过ewebeditor在线编辑器吗,为什么在改代码后总是不能提交呢。能编辑,就是不能提交,改了跟没改一样。

<input type="hidden" name="content1" value="<%=Server.HTMLEncode(oRs("D_Content"))%>">
<iframe ID="eWebEditor1" src="/ewebeditor.asp?id=content1&style=standard" frameborder="0" scrolling="no" width="500" HEIGHT="350"></iframe>
或者
<textarea name="content1" style="display:none"><%=Server.HTMLEncode(oRs("D_Content"))%></textarea>
<iframe ID="eWebEditor1" src="/ewebeditor.asp?id=content1&style=standard" frameborder="0" scrolling="no" width="500" HEIGHT="350"></iframe>
注意事项:

eWebEditor允许在同一表单里有多个,但请保证id在整个网页中是唯一的。即如果已经用了input name=content1第二个调用就要input name=content2之类的。
在使用textarea作为原表单项时,要加入style="display:none"。
在input修改时一定要用value="",而不是value=''。
一定要在动态加入value值时用Server.HTMLEncode()进行处理,否则有可能内容被截掉。

<textarea name="content" style="display:none"><%=Server.HTMLEncode(Rs("Content"))%></textarea>
<iframe ID="eWebEditor1" src="/ewebeditor.asp?id=content&style=standard" frameborder="0" scrolling="no" width="500" HEIGHT="350"></iframe>
posted @ 2009-09-24 10:47    阅读(763)  评论(0编辑  收藏  举报