I have build a BlogApp and I am working on Forms. BUT I want to add two Widgets
in One Form
and Both widgets are for one same Field
.
forms.py
class EditBlogPost(forms.ModelForm):
class Meta:
model = BlogPost
fields = ['title']
widgets = {'title':forms.TextInput(attrs={'placeholder': 'e.g. For Painting, For Sculpting'})}
widgets = {'title' : forms.Textarea(attrs={'cols':30})}
The Problem
When I put TextInput
widget right below fields instance
then TextInput
widget works in Browser page but Textarea
doesn't work AND when I put Textarea
widget below fields instance then Textarea
works and TextInput
doesn't work. BUT I want them to run both at same time.
I don't know what to do.
Any help would be Appreciated.
Thank You in Advance
question from:
https://stackoverflow.com/questions/65868255/two-widgets-in-one-form-in-same-fields-are-not-adding 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…