Thursday, 17 October 2013

Null checking in Editor

<script language="javascript" type="text/javascript">
            function test() {              
                var a = $find("<%=Editor1.ClientID%>");
                var value = a.get_content();              
                //alert(value);
                value = value.replace(/<br \/>/gi, '');
                value = value.replace(/&nbsp;/gi, '');
                value = value.replace(/^\s+|\s+$/g, '')
                //alert(value);
                //alert((value).replace(/<br \/>/gi, ''));
            if (value == "") {
                alert("Editor's content is empty");
                return false;
            }
        }
    </script>