关于FCKeditor内容是否为空?

Eclipse_80 2010-10-21 04:45:21
FCKeditor已经添加了图片,但是还是报内容不得为空!
js方法如下:

function commitForm(){

if(/^\s*$/.test((FCKeditorAPI.GetInstance("news.ncontent").EditorDocument.body.innerText))){
alert("内容不得为空");
return false;
}


调用FCKeditor实体

<!-- fckeditor -->
<script type="text/javascript" src="<%=basePath %>fckeditor/fckeditor.js"></script>
<script type="text/javascript">

window.onload = function()
{
// Automatically calculates the editor base path based on the _samples directory.
// This is usefull only for these samples. A real application should use something like this:
// oFCKeditor.BasePath = '/fckeditor/' ; // '/fckeditor/' is the default value.
var sBasePath = "<%=request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+request.getContextPath()+"/fckeditor/"%>"
var oFCKeditor = new FCKeditor( 'news.ncontent' ) ;
oFCKeditor.BasePath = sBasePath ;
oFCKeditor.ReplaceTextarea() ;
}
</script>
<!-- end of fvkeditor -->


其中内容(news.ncontent )是一个textarea被FCKeditor替换,提交的时候调用commitForm()方法!
麻烦高人帮忙看下!谢谢
...全文
130 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复

67,512

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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