donoworuq450547191 2016-10-27 20:53
浏览 929
已采纳

如何使用内联TinyMCE编辑器提交没有输入的表单内容?

Here's how they tell you to do it in the docs.

  <form method="post" action="process.php">
    <div class="wysiwyg">Click here to edit the first section of content!</div>
    <input type="submit">
  </form>

Then in the head of the document:

tinymce.init({ selector: '.wysiwyg',
        inline: true,
etc...

But I need to assign a name to the content of the div so my php processing page can get the content. How would I do this?

I tried to change to the get method, and it seems to use "mce_0" as a name.

  • 写回答

1条回答 默认 最新

  • dongliu4320 2016-10-27 21:37
    关注

    Try to do it manually, for example, put an id to your wysiwyg

    <div id="my-wysiwyg" class="wysiwyg">Click here to edit the content!</div>
    

    then get the value

    var txt = $('#my-wysiwyg').html();
    

    then make a post manually

    $.post('my.php', {wysiwyg: txt}, function onSuccess(response){
      console.log(response);
    });
    

    Then, in your php, you will get a name wysiwyg. This is just an illustrative example of how you can do it, adapt to your context.

    Check this out. Hope it helps

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?