Maelish Maelish - 6 months ago 50
jQuery Question

What is the default textarea name for Summernote?

Can someone help me with the default

textarea
name value for Summernote? The editor looks correct on the page (I can modify text using the interface) but POST isn't working based on my understanding.

I've tried a variety of POST variables but none of them seem correct. Examples are
summernote
,
note-codable
and
text-area
. The last two came from summernote.js. Jquery isn't something that I have much experience with, so please baby-step me.

These are what I am using.

$('#summernote').summernote({height: 300});
var sHTML = $('#summernote').code();


and

<div name="summernote" id="summernote"><?php echo $news_body; ?></div>


I've also tried the lines below separately in an attempt to change the textarea name to
content
:

var sHTML = $('#summernote').code();
$('#summernote').code();
var content = $('textarea[name="content"]').html($('#summernote').code());
$('textarea[name="content"]').html($('#summernote').code());
var sHTML = $('textarea[name="content"]').html($('#summernote').code());
var textareaValue = $("#content").code();
$("summernote").code(html);

Answer Source

This turned out to be a very simple fix. The root of the confusion is the documentation that says to use a div. Just use a text-area instead. Although summernote creates a text-area dynamically, do it anyway. It'll work.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download