I'm not a pro with ajax and javascript in general so I have to ask. I have a form with an editor inside (summernote editor)
<div id="summernote">summernote text</div>
Then I send form data throught this ajax function:
$( '#form-create-project' ).submit( function( e ) {
$.ajax({
url: 'create_project.php',
type: 'POST',
data: new FormData( this ),
processData: false,
contentType: false
});
e.preventDefault();
});
But I can't find a way to pass the summernote value too, I've tried with that:
var content = $('textarea[name="content"]').html($('#summernote').code());
but I don't know where to place that inside the js above. When I try to insert it the form on submit refresh the page instead of execute ajax, so I think I placed it in the wrong place.
Someone can help me?