我遇到了无法提交form
的问题,因为我的描述textarea
是required
却是hidden
中的form
。知道我该如何解决吗?我不知道style="display:none;"
的来源。有想法吗?
class CustomFroalaEditor(FroalaEditor):
def __init__(self, *args, **kwargs):
super(CustomFroalaEditor, self).__init__(*args, **kwargs)
def render(self, name, value, attrs=None, renderer=None):
html = super(FroalaEditor, self).render(name, value, attrs)
return mark_safe(html)
class NewBlaForm(forms.ModelForm):
description = forms.CharField(widget=CustomFroalaEditor(attrs={'id': 'nb__description-editor'}))
class Meta:
model = Bla
fields = ('description')