模板

<script src="{{ url_for('static', filename='ckeditor/ckeditor.js') }}"></script>
<script type=text/javascript>
    function CKupdate() {
                for (instance in CKEDITOR.instances)
                    CKEDITOR.instances[instance].updateElement();
    }
</script>
<label>{{ form.ann_content.label }}</label>
            {{ form.ann_content(style="margin: 0px; width: 711px; height: 250px;",class="ckeditor" ,rows="10",cols="80") }}
            <script>
                // 用CKEditor替换<textarea >
                // 使用默认配置
                CKEDITOR.replace('ann_content', {
                    enterMode: CKEDITOR.ELEMENT_MODE_REPLACE}
                );
            </script>

提交表单之前先执行

CKupdate()

form里面写

ann_content = TextAreaField(u'公告内容')

ckeditor下载地址

http://ckeditor.com/download

相关文章:

  • 2021-09-30
  • 2022-12-23
  • 2022-12-23
  • 2021-06-18
  • 2021-07-04
  • 2022-03-07
  • 2021-08-11
猜你喜欢
  • 2022-12-23
  • 2021-06-17
  • 2021-10-23
  • 2021-08-25
  • 2022-12-23
  • 2021-10-27
  • 2021-09-19
相关资源
相似解决方案