I'm using the ckeditor 3.4 as text editor for my website, and want to validate the data at client side first, before submitting the data to server.
I can get the data of editor by using this code: var editorData = CKEDITOR.instances.editor1.getData();
but having trouble to validate data. The problem is: - The data should be invalid if user didn't enter anything into editor or enter only some space or line break (null data)
by default, CKEDITOR.instances.editor1.getData() return <br />
if user didn't type anything and return
<p>
</p>
<br />
if user enter a line break (may be many <p> </p>
if user enter many line break)
please help me to check this case should be invalid (null data) both at client side (js - jquery 1.4.2) and server side (php 5)?
thanks