issue saving summernote in DB
<p>I have an issue saving summernote value in DB using ajax but when i dont use ajax everything is working.</p>

<p>to make it clear.</p>

<pre><code>&lt;?php
  include 'db.php';
  $db=new db;

  if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) &amp;&amp; !empty($_SERVER['HTTP_X_REQUESTED_WITH']) &amp;&amp; strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest'){
    if($_POST['act']=='save'){
      $content=$_POST['content'];
      $id=25;

      $query="UPDATE content SET content=? WHERE id=?";
      $db-&gt;execquery($query, 'si', array($content, $id));
      echo json_encode(array("response"=&gt;'success'));
      exit();
    }
  }
?&gt;

&lt;!DOCTYPE html&gt;
&lt;html lang="en"&gt;
&lt;head&gt;
  &lt;meta charset="UTF-8"&gt;
  &lt;meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /&gt; 
  &lt;title&gt;summernote&lt;/title&gt;
  &lt;!-- include jquery --&gt;
  &lt;script src="//code.jquery.com/jquery-1.11.3.min.js"&gt;&lt;/script&gt; 

  &lt;!-- include libraries BS3 --&gt;
  &lt;link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.1/css/bootstrap.min.css" /&gt;
  &lt;script type="text/javascript" src="//netdna.bootstrapcdn.com/bootstrap/3.0.1/js/bootstrap.min.js"&gt;&lt;/script&gt;

  &lt;!-- include summernote --&gt;
  &lt;link rel="stylesheet" href="../dist/summernote.css"&gt;
  &lt;script type="text/javascript" src="../dist/summernote.js"&gt;&lt;/script&gt;

  &lt;script type="text/javascript"&gt;
    $(function() {
      $('.summernote').summernote({
          toolbar: [
            // [groupName, [list of button]]
            ['style', ['bold', 'italic', 'underline', 'clear']],
            ['font', ['strikethrough', 'superscript', 'subscript']],
            ['fontsize', ['fontsize']],
            ['color', ['color']],
            ['para', ['ul', 'ol', 'paragraph']],
            ['height', ['height']]
          ]
        });

      $('form').on('submit', function (e) {
        e.preventDefault();

        content=$('.summernote').summernote('code');
        data='act=save&amp;content='+content;
        $.ajax({
          type: "POST",
          dataType: "JSON",
          data: data,
        })
        .fail(function(e){
            alert(e.response);
        })
        .done(function(data){
            if(data.response=='success'){
                alert('success!');
            }
        });
      });
    });
  &lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;form action="#" novalidate&gt;
  &lt;div class="form-group"&gt;
    &lt;label for="input"&gt;Text&lt;/label&gt;
    &lt;textarea class="form-input" id="input"&gt;&lt;/textarea&gt;
  &lt;/div&gt;
  &lt;div class="form-group"&gt;
    &lt;label for="contents"&gt;Contents&lt;/label&gt;
    &lt;textarea name="text" class="summernote" id="contents" title="Contents"&gt;&lt;/textarea&gt;
  &lt;/div&gt;
  &lt;button type="submit" class="btn btn-default"&gt;submit&lt;/button&gt;
&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>Anyway when I just type simple texts in summernote the values are being saved but when I paste some text from msword something like that the values being saved are cut.</p>

<p>I tried something that when I press submit I am also putting the summernote values into an extra textarea then when I paste the values manually in DB everything is good. I also tried copying the codeview values then paste in DB manually then it's good also. Please help.</p>

<p>Thanks in advance!</p>