0
votes

I'm using Tinymce Editor on my website but when I submit the form I got input data without textarea. So, my question is how to keep the textarea with Tinymce Editor after submitting the form?

Looking for your answers guys.

Best regards

2

2 Answers

0
votes

Assuming you are in PHP, you can put the post data back in the textarea. Something like this:

<form method="post" action="yourpage.php">
    <textarea name="content">
    <?php
        if(isset($_POST['submit'])){
        echo $_POST['content'];
        }
    ?>
    </textarea>
    <input type="submit" name="submit" value="Submit">
    </form>
0
votes

Here is my code:

tinymce.init({
                mode: "exact",
                elements: "zone_textarea_mceEditor",
                plugins: [
                    "advlist autolink lists link image charmap print preview anchor",
                    "searchreplace visualblocks code fullscreen",
                    "insertdatetime media table contextmenu paste codemirror responsivefilemanager"
                ],
                toolbar1: "undo redo | bold italic underline | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | styleselect",
                toolbar2: "| responsivefilemanager | link unlink anchor | image media | forecolor backcolor  | print preview code ",
                image_advtab: true,
                autosave_ask_before_unload: false,
                height: 200

    });

Also, you can find bellow the image before and after submit the form: Before submit the form

After: After submit the form

What I'm looking for is the keep the first layout after submitting the form.