asp.net 自定义控件验证FCKeditor是否为空

//验证FCKeditor是否为空
function FckCustomValidate(source, arguments) {
    var fckFrame = document.getElementById(source.controltovalidate + "___Frame").contentWindow;
    var value = fckFrame.FCK.GetHTML(fckFrame.FCKConfig.FormatOutput);
    if (value == "") {
        arguments.IsValid = false;
    }
    else {
        arguments.IsValid = true;
    }
}

<FCKeditorV2:FCKeditor ID="fckContent" runat="server" Width="100%" Height="400px">
        </FCKeditorV2:FCKeditor><asp:CustomValidator ID="CustomValidator1" runat="server" ErrorMessage="必填" ControlToValidate="fckContent" ClientValidationFunction="FckCustomValidate"></asp:CustomValidator>

原文地址:https://www.cnblogs.com/yuncheng/p/2792238.html