i have a django modelform that some of it’s fields are required. i’m using {{ form.as_p }} and i’m not accessing the fields individually.
so how can i add a star (*) for that required fields in the form ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you will not be accessing the fields individually (such as using {{ form.as_p }}), then you can add a property to your ModelForm:
That will define all fields that are required as having the ‘required’ class
Then you can add the asterisk using CSS :