Deleting the Form Field Label in Django
Reishi Mitani
Posted on August 29, 2020
The label Comment Text
kept appearing on the form.
By adding the labels dictionary in the form
file, I was able to get rid of the label.
class CommentForm(forms.ModelForm):
class Meta:
model = Comment
fields = ['comment_text', ]
labels = {
"comment_text": ""
}
💖 💪 🙅 🚩
Reishi Mitani
Posted on August 29, 2020
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.