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>

posted @ 2012-11-28 11:30  云城  阅读(125)  评论(0编辑  收藏  举报