我的受限tinymce编辑器在我的html页面上的格式为:
DescTools
其后面具有以下形式:
{{ wtf.quick_form(form) }}
<script type="text/javascript" src="{{ url_for('static', filename='tinymce/tinymce.min.js') }}"></script>
<script type="text/javascript">
tinymce.init({
selector: '#body',
toolbar: 'fontsizeselect',
fontsize_formats: '8pt 10pt 12pt 14pt 16pt 18pt 24pt 36pt 48pt',
menubar: 'edit format',
menu: {
edit: { title: 'Edit', items: 'undo redo | cut copy paste | selectall | searchreplace' },
format: { title: 'Format', items: 'bold italic underline strikethrough superscript subscript'},
},
width: "100%",
});
</script>
这是路线:
class TenderForm(FlaskForm):
username = StringField(('Username'), [validators.DataRequired()])
title = StringField(('Title'), [validators.DataRequired()])
body = TextAreaField(('Input'), [validators.DataRequired()])
user_id = IntegerField(('id number'), [validators.DataRequired()])
submit = SubmitField(('Submit'))
当我点击“提交”时,什么也没有发生。但是,如果我删除tinymce编辑器,我的输入将按预期提交到数据库。请有人能告诉我我在做什么错吗?