Is it possible to remove tinymce default html?
<p><br data-mce-bogus="1"></p>
Those bogus elements are usually getting removed onSave or getContent(). You won't be able to see them using the code plugin eighter.
The br in this case is necessary in Firefox in order to be able to click into the paragraph.
A workaround is to apply a "untag" function over the iframe text, to make sure the user wrote something that is NOT tags, I mean, some innerHTML or pure text:
function untag(text){
var t = "" + text;
t = t.replace(/<[^>]+>/g, "");
return t;
}
var msg = $('your_mce_iframe_id').html();
if( untag(msg) != "" ){
// user wrote anything, validation ok
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With