samedi 25 juin 2016

Trumbowyg: data not posted if only an iframe

For a website, I use the jQuery Wysiwyg "Trumbowyg". I have put the plugin "noembed" to add video.

Unfortunately, I've noticed something strange: when I try to add only a video ('iframe' from Youtube, for example) in Trumbowyg, the field is always empty when I get the value in PHP.

But if I put the same video with something else (a simple text by example), the field is not empty and the variable "$_POST" contains all datas (video + text) written previously in my editor.

Here my code:

<form method="post" action="sub.php">
    <textarea name="description" id="trumbowyg_editor"></textarea>
    <input type="submit" value="OK" />
</form>
<script>
    $('#trumbowyg_editor')
    .trumbowyg({
        btnsDef: {
            // Create a new dropdown
            link: {
                dropdown: ['createLink', 'unlink', 'noembed'],
                ico: 'link'
            }
        },

        btns: ['viewHTML',
                '|', 'link']
    });
</script>

If I display the variable with "console.log($('#editor').trumbowyg('html'))", I notice the same thing.

How to fix this issue?

Aucun commentaire:

Enregistrer un commentaire