js方法如下:
-
JScript code
-
function commitForm(){ if ( / ^\s*$ / .test((FCKeditorAPI.GetInstance( " msg.content " ).EditorDocument.body.innerText))){ alert( " 内容不得为空 " ); return false ; } }
调用FCKeditor实体:
-
JScript code
-
<!-- fckeditor --> < script type = " text/javascript " src = " <%=basePath %>fckeditor/fckeditor.js " >< / script> < script type = " text/javascript " > window.onload = function(){ var oFCKeditor = new FCKeditor("msg.content"); oFCKeditor.BasePath = "<%= request.getContextPath() %>/components/fck/"; oFCKeditor.Height = '100%'; oFCKeditor.ReplaceTextarea(); } < / script> <!-- end of fvkeditor -->
-