2009.2

10

如何获取FCKEditor的值

作者: admin | 类别: 技术文档| 查看: 2761

常规的用法:
在页面插入
<script type="text/javascript" src="/editor/fck_editor/fckeditor.js"></script>
<script type="text/javascript">
window.onload = function()
{
var oFCKeditor = new FCKeditor('Content', 730, 450) ;
oFCKeditor.BasePath = "/editor/fck_editor/";
oFCKeditor.ReplaceTextarea();
}

function getFckeditorText(editor_name)
{
var oEditor = FCKeditorAPI.GetInstance(editor_name) ;
returnValue = oEditor.GetXHTML(true);

return returnValue;
}
function checkData(sTargetName) {
document.getElementById(sTargetName).value = getFckeditorText(sTargetName);
//加入其它判断检测输入。
return true;
}
</script>
<form id="form1" name="form1" method="get" onsubmit="return checkData('Content');">
<textarea name="Content" id="Content"></textarea>
<input type="submit">
</form>

评论(1)

站长评论