I have a form like the following:
class MyForm(Form):
#personal data
firstname = CharField()
lastname = CharField()
#education data
university = CharField()
major = CharField()
#foobar data
foobar = ChoiceField()
Since some fields (like foobar) are populated from the database i can't use another method other than letting Django render it for me with form.as_ul
Also i wish i don't have to split the form in multiple forms for ease of mantainance
Is there a way to tell Django to display a help text in between these form sections so that i can put in some instructions on how to fill the form?
I'd like the form to render something like this:
<form>
<p>Here you enter your personal data...</p>
<input name='firstname'>
<input name='lastname'>
<p>Here you enter your education data...</p>
<input name='university'>
<input name='major'>
</form>
Would i need to create my own widget to be able to display those <P>
tags, or is there an easier way?
Thanks
There is a help_text
field in forms you know.
in forms.py:
myField = forms.myFieldType(help_text="Helping friendly text to put in your form", otherStuff=otherStuff)
in forms.html:
{{form.myField.help_text}}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With