微小的编辑没有获得后期价值

时间:2013-07-24 17:49:40

标签: php jquery codeigniter iframe rich-text-editor

这是我正在使用的代码

<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>

我的帖子输出就像这样

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

如果我从文本区域中删除id="tinyeditor",则后期值即将到来

2 个答案:

答案 0 :(得分:3)

您需要使用JS发布编辑器中的数据:

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

其中.submit是提交按钮类

答案 1 :(得分:0)

简单方法:

粘贴你的脚本:

var 编辑器 =新TINY.editor.edit('editor',{     id:'tinyeditor',     等.....

按钮表单上的

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

etvoilà