Tiny editor is not getting post value

2019-05-26 08:12发布

Here is the code i am using

<textarea name="tinyeditor" id="tinyeditor" style="width: 800px; height: 500px"></textarea>
<script>
   var editor = new TINY.editor.edit('editor', {
    id: 'tinyeditor',
    width: 750,
    height: 350,
    cssclass: 'tinyeditor',
    controlclass: 'tinyeditor-control',
    rowclass: 'tinyeditor-header',
    dividerclass: 'tinyeditor-divider',
    controls: ['bold', 'italic', 'underline', 'strikethrough', '|', 'subscript', 'superscript', '|',
        'orderedlist', 'unorderedlist', '|', 'outdent', 'indent', '|', 'leftalign',
        'centeralign', 'rightalign', 'blockjustify', '|', 'unformat', '|', 'undo', 'redo', 'n',
         'image', 'hr', 'link', 'unlink', '|', 'print'],
    footer: true,
    fonts: ['Verdana','Arial','Georgia','Trebuchet MS'],
    xhtml: true,        
    bodyid: 'editor',
    footerclass: 'tinyeditor-footer',
    toggle: {text: 'source', activetext: 'wysiwyg', cssclass: 'toggle'},
    resize: {cssclass: 'resize'}
   });
</script>

My post output is coming like this

Array ( [tinyeditor] => [templatename] => test [content] => [textedito] => [Submit_x] => 48 [Submit_y] => 14 ) 

if i remove id="tinyeditor" from the text area then post value is coming

2条回答
一纸荒年 Trace。
2楼-- · 2019-05-26 08:21

easy way :

Paste your script :

var editor = new TINY.editor.edit('editor', { id: 'tinyeditor', etc.....

on the button form

input type="submit" value="Envoyer" onClick="editor.post();"

et voilà

查看更多
混吃等死
3楼-- · 2019-05-26 08:37

You need to post the data from editor with JS:

$(document).ready(function(){ $(".submit").click(function(){ editor.post(); }); });

Where .submit is class of submit button

查看更多
登录 后发表回答