调用:
step 1:
头部引用:
<!-- #i nclude file="FCKeditor/fckeditor.asp" -->
step 2:
显示编辑器的from内插入如下代码:
<%
Dim oFCKeditor
Set oFCKeditor = New FCKeditor
oFCKeditor.BasePath = "/FCKeditor/"
oFCKeditor.Create "FCKeditor1"
%>FCKeditor1就是from传递数据的名称了
step 3:
完整的代码如下:
<!-- #i nclude file="FCKeditor/fckeditor.asp" --> <html> <head> <title>FCKeditor - Sample</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> </head> <body> <form action="savedata.asp" method="post"> <% Dim oFCKeditor Set oFCKeditor = New FCKeditor oFCKeditor.BasePath = "/FCKeditor/" oFCKeditor.Create "FCKeditor1" %> <br> <input type="submit" value="Submit"> </form> </body> </html>
step 4:
可以这样来取得编辑器的值:
Dim sValue
sValue = Request.Form( "FCKeditor1" )
判断内容是否为空:
var checkContent =FCKeditorAPI.GetInstance("FCKeditor1").GetXHTML();
if (checkContent==""){
alert("文章内容不能为空!");
var oEditor = FCKeditorAPI.GetInstance('FCKeditor1');
oEditor.Focus();
return false;
}
减肥参考:http://www.blueidea.com/tech/program/2005/2691.asp
可以这样来定制编辑器:
<%
Dim oFCKeditor
Set oFCKeditor = New FCKeditor
oFCKeditor.BasePath = "/fckeditor/"
oFCKeditor.ToolbarSet = "Default"
oFCKeditor.Width = "100%"
oFCKeditor.Height = "500"
oFCKeditor.Value = rs("message")
oFCKeditor.Create "FCKeditor1"
%>