I am struggling here to find a solution to using
div
using contenteditable
PHP
<div class="panel-body">
<div contenteditable="true" style="text-align: justify" id="text_data_1">
<?php echo(html_entity_decode($text_data_from_backend))?>
</div>
</div>
jQuery
var postFormData = {
'agent_id' : $("#text_data_1").val(),
'actionmode' : id
};
var link = 'myfile.php';
$.fn.getajaxresponse(link, postFormData, $.fn.this_callback);
Data is pasted or typed into the div which is contenteditable. The whole html layout fails when end users paste content from websites with tags that are not closed properly.
I am using div contenteditable
so that new lines and basic html tags are preserved and can be transacted back and forth to database.
Is there a way to remove html tags that are not closed properly and I believe this is the show stopper in getting this methodology in place. Please note I use jQuery, PHP and MySQL