crispy form field type attribute ignored

@Martin Beran pointed me in the right direction. Since I am trying to stay with the {% crispy form %} method… I found that using the widgets override in the Meta class provided what I needed!

    class Meta:
        model=Reminder
        exclude=['sentdate','confirmdate','completedate']
        widgets = {
            'reminddate': forms.DateInput(attrs={'type':'date'}),
            'duedate': forms.DateInput(attrs={'type':'date'})
        }

Form with bootstrap date control

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top