artEditor.js是一款移动端的富文本编辑器,支持图片上传,后面会增加表情、小视频等功能。最近有朋友反馈artEditor是否支持表单提交,当然是支持的,在未开发该功能之前,你可以像下面这样来实现表单提交

$('.submit').on('click', function(e) {
    e.preventDefault();
    $('.hidden').val($('#artEditor').getValue());
    $(this).submit();
});

新功能:

  新增formInputId参数,该参数表示form隐藏域的id,会将编辑器内容放到隐藏域中,如下:

<form action="">
    <input type="hidden" >
    <div >
    </div>
</form>
<script>
    $('#artEditor').artEditor({
        formInputId: 'target'
    });
</script>

 

相关文章:

  • 2021-07-18
  • 2022-01-11
  • 2021-12-17
  • 2021-11-29
  • 2021-06-29
  • 2021-11-18
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-04-07
  • 2021-06-18
相关资源
相似解决方案