<FCKeditorV2:fckeditor id="Message" runat="server" height="300px" width="500px" basepath="~/fckeditor/"
                                    toolbarset="tradakFace">
                                </FCKeditorV2:fckeditor>怎么在前端判断是否为空呢???

解决方案 »

  1.   

    要看一下最終輸出的瀏覽器的HTML代碼
      

  2.   


    var  oEditor  =  FCKeditorAPI.GetInstance("<%=Message.ClientID %>") ;
    if(oEditor.GetXHTML(true).Trim().length == 0)
    {
         alert("不能为空!");
    }
      

  3.   

    function getEditorHTMLContents(EditorName)

        var oEditor = FCKeditorAPI.GetInstance(EditorName); 
        return(oEditor.GetXHTML(true)); 
    }
    获取编辑器中文字内容
    function getEditorTextContents(EditorName)

        var oEditor = FCKeditorAPI.GetInstance(EditorName); 
        return(oEditor.EditorDocument.body.innerText); 
    }
    参考