Can't validate field in CBV with django-ckeditor

Viewed 176

I have view (CBV) with django-ckeditor on front-end side. Everything is working, but I can't validate text field (is mandatory), when I'm clicking "Post comment" button, I don't receive any message that this field is required.

Below is my code.

form.py

class Comment(forms.ModelForm):
    text = forms.CharField(widget=CKEditorUploadingWidget(), label='', required=True)

    class Meta:
        model = Comment

form in template:

    <form action="" method="POST">
        {% csrf_token %}
        {{ form.media }}
        {{ form.as_p }}
        <button type="submit" class="btn btn-primary">Post comment</button>
    </form>
0 Answers
Related