title: Why input value of CodeMirror Editor can't be save into database
body: <p>I have problem where value that entered by user can't be save into database.
  The user input the value in textarea, which now i replaced it with CodeMirror Editor.</p>
  
  <p>Below are my codes.</p>
  
  <p>Notes that other field in the form that input by the user can be saved.
  Any help? I've tried to search the solution but I did'nt find any. Thank you.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>/* MY JAVASCRIPT */
  /*THIS IS FUNC TO SAVE MY DATA FROM FORM*/
  function saveData() {
  
    $.ajax({
      type: "POST",
      url: "api/insert_update_builder_sql.php",
      data: $('#sqlForm').serialize(),
      success: function(result) {
        $('#myModal').modal('hide');
        alert("Data Save : " + result);
        $('#sqlForm')[0].reset();
        loadData();
      }
    });
  }
  
  
  /*THIS IS LINE OF CODES FOR CODEMIRROR EDITOR*/
  var editor = CodeMirror.fromTextArea(document.getElementById("inputSQLState"), {
    lineNumbers: true,
    matchBrackets: true,
    value: document.getElementById("inputSQLState"),
    mode: "text/x-mariadb"
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!-- MY HTML FILE --&gt;
  &lt;!--THIS IS TEXTAREA CODES --&gt;
  &lt;div class="form-group"&gt;
    &lt;label for="inputSQLState" class="col-sm-3 control-label" style="font-size:16px"&gt;SQL Statement :&lt;/label&gt;
    &lt;div class="col-sm-9"&gt;
      &lt;textarea class="form-control" id="inputSQLState" rows="10" name="inputSQLState"&gt;
      &lt;/textarea&gt;
    &lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>