Tiny editor is not getting post value

别说谁变了你拦得住时间么 提交于 2019-12-07 23:58:04

问题


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


回答1:


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




回答2:


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à



来源:https://stackoverflow.com/questions/17841262/tiny-editor-is-not-getting-post-value

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!