[Answered ]-How can a django forms.CharField generate a required input?

2👍

Use attrs

Try this,

mail_to=forms.CharField(required=True, widget=forms.TextInput(attrs={'required': "required"}))

You can see this,

<input id="id_mail_to" name="mail_to" required="required" type="text">

JsFiddle

👤dhana

0👍

You can try like this in forms.py

mail_to= forms.CharField(required=True, label="mail to")
👤ruddra

Leave a comment