I have a CodeIgniter view that uses the Summernote
<div class="col-lg-12 col-sm-12 col-xs-12">
<label for="definpu">Requirement</label>
<textarea class="input-block-level" id="requirement" name="requirement" rows="18">
<?php if (isset($selected_record)): echo htmlspecialchars_decode($selected_record->requirement); endif; ?>
</textarea>
</div>
...
<script src="<?php echo base_url(); ?>assets/js/editors/summernote/summernote.js"></script>
<script>
$('#requirement').summernote({ height: 100 });
</script>
`
If I write a text and format it using the Summernote options then it seems to be working (I haven't tried all of them), however when I copy / paste from a word document it doesn't even come up in $_POST. So depending of the content of the Text Area, the value retrieved in $_POST is either the text (if simple format) or empty string (if format is for some reason unaccepted).
In my case the text is pasted from Word and I can see the source the Summernote generates, it looks fine:
`
echo '<style type="text/css">p { margin-bottom: 0.08in; direction: ltr; font-size: 12pt; text-align: left; background: transparent none repeat scroll 0% 0%; }a:link { color: rgb(0, 0, 255); text-decoration: underline; }a.ctl:link { font-family: "Times New Roman"; }a.sdfootnotesym-ctl { font-family: "Times New Roman"; }</style>
<ul><li><p style="margin-top: 0.04in; margin-bottom: 0.04in; line-height: 115%" align="justify">
<font face="Calibri, serif"><font style="font-size: 11pt" size="2"><font face="Arial, serif"><font style="font-size: 10pt" size="2">Be
able to EDIT the “fixed cells (i.e. Job Type, Request Type, etc.)
without it requiring us to redo the entire request.</font></font> </font></font></p>
</li></ul>';
`
however when I hit Save (Submit) the $_POST for my area is empty. If I start to type the text myself then it works, but of course format will be different.
So is there a way to overcome this and, if code can be generated from a copy/paste, to save it in the database and then displayed?
Again, my issue is to save it to database. To retrieve I use "htmlspecialchars_decode" and this seems to resolve the issue of displaying correctly.
Thank you!