I have the following form:
class ProfileForm(forms.ModelForm):
class Meta:
model = Profile
fields = ('title', 'dob')
labels = {
'dob': ('D.O.B'),
}
Which is based on the following model:
class Profile(models.Model):
user = models.OneToOneField(User)
title = models.CharField(max_length=10)
dob = models.DateField(max_length=8)
class Meta:
managed = True
db_table = 'fbf_profile'
the HTML part is as follows:
<div class="form-group">
<label class="col-sm-5 control-label">{{ profileform.dob.label }}:</label>
<div class="col-sm-7">
{{ profileform.dob }}
<div class="text-danger">
{% for error in profileform.dob.errors %}{{ error }}<br/>{% endfor %}
</div>
</div>
</div>
It is displaying correctly but in it's current format the user has to type their date of birth manually. I would like a date picker that allows them to choose day, month, year from three separate drop down boxes. Any idea on the best way to achieve this? Or if someone has any better ways they think selecting date of birth then I am open to ideas.
Many thanks, Alan.