Medium-editor: Allow using a <textarea> instead of a <div>

Created on 2 Dec 2013  路  22Comments  路  Source: yabwe/medium-editor

Most WYSIWYG editors use <textarea>, but since this one uses <div>, it's very difficult to integrate with existing CMSes (such as Drupal). Any chance <textarea> support could be added?

Most helpful comment

As @daviferreira this is how Im doing it.

  $(function() {
    var editor = new MediumEditor('.editable');
    $(".js-form").submit(function( event ) {
      event.preventDefault();

      var contentObj = editor.serialize();
      $(".js-content-hidden").val(contentObj['element-0'].value);
      this.submit();

    });
  });

All 22 comments

You can easily solve this with a bit of javascript, just use the serialize method and some hidden inputs.

I have personally wished for this feature as well. Since most of the projects I work on have a need for a rich text field inside a <textarea>

:+1:

I also want this too! Although I understand that by using div I can still submit forms using Javascript/AJAX, many of my codes I work on are still using the old html form method. It will save me a lot of troubles if I can use the editor in