<script type="text/javascript" src="${path}/fckeditor/fckeditor.js"></script> <script type="text/javascript"> var oFCKeditor; window.onload = function(){ oFCKeditor = new FCKeditor("content") ; oFCKeditor.BasePath = "${path}/fckeditor/"; oFCKeditor.Height = 300; oFCKeditor.ToolbarSet = "Mybbs"; oFCKeditor.ReplaceTextarea(); } //提交判断非空 function validate(){ var oEditor = FCKeditorAPI.GetInstance("content"); if(oEditor.GetXHTML() == "" || oEditor.GetXHTML() == "<br />"){ alert("内容不能为空!"); return; } } </script> <body> ...... <textarea name="content" id="content"></textarea> ...... </body>
?