I am using a text editor on certain form fields, TinyMCE. it works ok.
However the TinyMCE editor returns a HTML body tag for each field in the form. T
its not a very ellegant solution but it works. i simply remove the tags from the document using the strip_tag(), then test if the variable is empty. If its not empty i submit the post variable.
if (isset($_POST['description']))
{
$preValidated = dsf_db_prepare_input($_POST['description']);
$testValue = trim(strip_tags($preValidated));
if(!strlen($testValue) >= 1)
{
$description ='';
}
else
{
$description ="$preValidated";
}
}
you can do it on the client side using jquery
if($('<html><body></body></html>').find('body').children().length < 1) {
console.log('empty')
} else {
console.log('not empty');
}
you can validate and send appropriate response to the server