Maelish Maelish - 3 years ago 224
jQuery Question

What is the default textarea name for Summernote?

Can someone help me with the default

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
. 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();


<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

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

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