Tinymce saves input from textarea but its not formated as an html text

20 Views Asked by At

it saves the inputed data as a plain text

i need it to be formated as html text

<script> tinymce.init({ selector: 'textarea.tinymce', height: "300", plugins: 'anchor autolink charmap codesample emoticons image link lists media searchreplace table visualblocks wordcount checklist mediaembed casechange export formatpainter pageembed linkchecker a11ychecker tinymcespellchecker permanentpen powerpaste advtable advcode editimage tinycomments tinydrive tableofcontents footnotes mergetags autocorrect typography inlinecss', toolbar: 'undo redo | blocks fontfamily fontsize | bold italic underline strikethrough | link image media table mergetags | addcomment showcomments | spellcheckdialog a11ycheck typography | align lineheight | checklist numlist bullist indent outdent | emoticons charmap | removeformat |', tinycomments_mode: 'embedded', tinycomments_author: 'Author name', mergetags_list: [ { value: 'First.Name', title: 'First Name' }, { value: 'Email', title: 'Email' }, ] }); </script>

`$('#submit-all').on('click', function() { $('#long_desc').val(tinyMCE.get("long_desc").getContent());

        $.ajax({
            url: "{{ route('course.store') }}",
            headers: {
                'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
            },
            data: fd,
            contentType: false,
            processData: false,
            type: 'POST',
            success: function(data) {
                if (data.flag == "success") {
                    show_toastr('success', data.msg, 'success');
                    window.location.href = "{{ route('course.index') }}";
                } else {
                    show_toastr('Error', data.msg, 'error');
                }
            },
            error: function(data) {
                // Dropzones.removeFile(file);
                if (data.error) {
                    show_toastr('Error', data.error, 'error');
                } else {
                    show_toastr('Error', data, 'error');
                }
            },
        });
    });`

<div class="col-md-12"> <div class="form-group"> {{ Form::label('long_desc', __('Course Description'), ['class' => 'col-form-label']) }} {{ Form::textarea('long_desc', null, ['class' => 'form-control tinymce','rows' => 2,'placeholder' => __(''),'id'=>'long_desc']) }} </div> </div>

0

There are 0 best solutions below