title: Django Form Date Input Field Not Showing Errors
body: <p>I have a form on a registration page that requires a date to be entered, along with a few other fields. If the user enters non-valid information into the date field (like a string) and submits the form, Django rejects the form as non-valid, but I don't get any error messages on the page - But for the other fields on the form, I do get error messages (ex: Passwords Don't Match, User Already Registered, etc).</p>
  <p>Here is what the form looks like:
  <a href="https://i.stack.imgur.com/FLWvE.png" rel="nofollow noreferrer">Link to image of registration form</a></p>
  <p>Here is my <strong>forms.py</strong> file - I'm using two classes to create the form on the registration page:</p>
  <pre class="lang-py prettyprint-override"><code>from django import forms
  from users.models import Profile
  from django.contrib.auth.models import User
  from django.contrib.auth.forms import UserCreationForm
  
  
  class CustomUserCreationForm(UserCreationForm):
      email = forms.EmailField(required=True)
  
      class Meta(UserCreationForm.Meta):
          model = User
          #fields = UserCreationForm.Meta.fields + (&quot;email&quot;,)
          fields = ['username', 'email', 'password1', 'password2']
  
  
  class EmployeeForm(forms.ModelForm):
  
      hireDate = forms.DateField(
          required=False,
          error_messages={'required': 'Please enter a valid date'},
          input_formats=[
              '%Y-%m-%d',  # '2006-10-25'
              '%m/%d/%Y',  # '10/25/2006'
              '%m/%d/%y'
          ])  # '10/25/06')
  
      class Meta:
          model = Profile
          fields = ['hireDate', 'employeeNumber']
  </code></pre>
  <p>Here is the <strong>models.py</strong> field with the model for the profile:</p>
  <pre class="lang-py prettyprint-override"><code>from django.db import models
  from django.contrib.auth.models import User
  from django.db.models.signals import post_save
  from django.dispatch import receiver
  
  
  class Profile(models.Model):
      user = models.OneToOneField(User, on_delete=models.CASCADE)
      #confirmed = models.BooleanField(&quot;Confirmed&quot;, default=False)
  
      hireDate = models.DateField(auto_now=False,
                                  auto_now_add=False,
                                  verbose_name='Date of Hire',
                                  null=True)
      employeeNumber = models.CharField(max_length=10,
                                        verbose_name='Employee Number',
                                        null=True)
  
  
  @receiver(post_save, sender=User)
  def create_user_profile(sender, instance, created, **kwargs):
      if created:
          Profile.objects.create(user=instance)
  
  
  @receiver(post_save, sender=User)
  def save_user_profile(sender, instance, **kwargs):
      instance.profile.save()
  </code></pre>
  <p>And here is the <strong>views.py</strong> that presents the form - I'm combining two forms into one, and submitting with one button/input. The problem seems to lie with the second form (EmployeeForm), the first form (CustomUserCreationForm) seems to work fine:</p>
  <pre class="lang-py prettyprint-override"><code>from django.contrib.auth import login
  from django.shortcuts import redirect, render
  from django.urls import reverse
  from users.forms import CustomUserCreationForm, EmployeeForm
  from users.models import User, Profile
  from django.contrib.auth.decorators import login_required
  from django.shortcuts import redirect
  from django.contrib import messages  #import messages
  
  
  def dashboard(request):
      return render(request, &quot;users/dashboard.html&quot;)
  
  
  #@login_required
  # @transaction.atomic
  
  
  def register(request):
      if not request.user.is_authenticated:
          if request.method == 'POST':
              form = CustomUserCreationForm(
                  request.POST)  #, instance=request.user)
              e_form = EmployeeForm(
                  request.POST)  #, instance=request.user.profile)
              if form.is_valid() and e_form.is_valid():
  
                  user = form.save()
                  user.refresh_from_db(
                  )  # load the profile instance created by the signal
                  e_form = EmployeeForm(request.POST, instance=user.profile)
                  e_form.full_clean()
                  e_form.save()
                  messages.success(request, f'Your account has been approved!')
                  return redirect('login')
  
          else:
  
              form = CustomUserCreationForm()
              e_form = EmployeeForm()
              print(form.errors)
              print(e_form.errors)
  
          context = {'form': form, 'e_form': e_form}
  
          return render(request, 'users/register.html', context)
  
      else:
          return redirect('dashboard')
  </code></pre>
  <p>And finally here is the html for the form on the <strong>template</strong> that presents the registration page - as you can see, I've tried a few different ways to get the form to present error messages, but none of them are working for the date field:</p>
  <pre class="lang-html prettyprint-override"><code>                            &lt;form class=&quot;text-center&quot; method=&quot;post&quot;&gt;
                                  {% csrf_token %}
                              
                              
                                  &lt;!--Username--&gt;
                                  &lt;div class=&quot;mb-3&quot;&gt;&lt;input class=&quot;form-control&quot; type=&quot;text&quot; name=&quot;username&quot; placeholder=&quot;Username&quot; required id=&quot;{{ field.id_username }}&quot;&lt;/div&gt;
                                  &lt;div class=&quot;text-danger&quot;&gt;
                                     {% for error in form.username.errors %}{{ error }}&lt;br/&gt;{% endfor %}
                                    &lt;/div&gt;
  
                                  &lt;!--Email--&gt;
                                  &lt;div class=&quot;mb-3&quot;&gt;&lt;/div&gt;
                                  &lt;div class=&quot;mb-3&quot;&gt;&lt;input class=&quot;form-control&quot; type=&quot;email&quot; name=&quot;email&quot; placeholder=&quot;Email&quot; required id=&quot;{{ field.id_email }}&quot;&lt;/div&gt;
                                  &lt;div class=&quot;text-danger&quot;&gt;
                                     &lt;!-- {% for error in form.register.errors %}{{ error }}&lt;br/&gt;{% endfor %} --&gt;
                                  &lt;/div&gt;
  
                                  &lt;!--Password--&gt;
                                  &lt;div class=&quot;mb-3&quot;&gt;&lt;/div&gt;
                                  &lt;div class=&quot;mb-3&quot;&gt;&lt;input class=&quot;form-control&quot; type=&quot;password&quot; name=&quot;password1&quot; autocomplete=&quot;password&quot; required id=&quot;{{ field.id_password1 }}&quot; placeholder=&quot;Password&quot;&gt;&lt;/div&gt;
                                  &lt;div class=&quot;text-danger&quot;&gt;
                                     {% for error in form.password1.errors %}{{ error }}&lt;br/&gt;{% endfor %}
                                    &lt;/div&gt;
                                  &lt;!--Password Confirm--&gt;
                                  &lt;div class=&quot;mb-3&quot;&gt;&lt;/div&gt;
                                  &lt;div class=&quot;mb-3&quot;&gt;&lt;input class=&quot;form-control&quot; type=&quot;password&quot; name=&quot;password2&quot; autocomplete=&quot;password&quot; required id=&quot;{{ field.id_password2 }}&quot; placeholder=&quot;Confirm Password&quot;&gt;&lt;/div&gt;
                                  &lt;div class=&quot;text-danger&quot;&gt;
                                    {% for error in form.password2.errors %}{{ error }}&lt;br/&gt;{% endfor %}
                                  &lt;/div&gt;
                                   &lt;!--Date of Hire --&gt;
                                  &lt;div class=&quot;mb-3&quot;&gt;&lt;/div&gt;
                                  &lt;div class=&quot;mb-3&quot;&gt;&lt;input class=&quot;form-control&quot; type=&quot;text&quot; name=&quot;hireDate&quot; autocomplete=&quot;Date of Hire&quot; required id=&quot;{{ field.id_hireDate }}&quot; placeholder=&quot;Date of Hire&quot;&gt;&lt;/div&gt;
                                  &lt;div class=&quot;text-danger&quot;&gt;
                                     {% for error in form.hireDate.errors %}{{ error }}&lt;br/&gt;{% endfor %}
                                  &lt;/div&gt;
                                  
                                  &lt;!-- Employee Number --&gt;
                                  &lt;div class=&quot;mb-3&quot;&gt;&lt;/div&gt;
                                  &lt;div class=&quot;mb-3&quot;&gt;&lt;input class=&quot;form-control&quot; type=&quot;text&quot; name=&quot;employeeNumber&quot; autocomplete=&quot;Employee Number&quot; required id=&quot;{{ field.id_employeeNumber }}&quot; placeholder=&quot;Employee Number&quot;&gt;&lt;/div&gt;
                                  &lt;div class=&quot;text-danger&quot;&gt;
                                     &lt;!-- {% for error in form.register.errors %}{{ error }}&lt;br/&gt;{% endfor %}--&gt;
                                  &lt;/div&gt;
  
                                  {{ form.non_field_errors }}
  
                                  {% if form.errors %}
                                      {% for field in form %}
                                          {% for error in field.errors %}
                                              &lt;p&gt; {{ error }} &lt;/p&gt;
                                          {% endfor %}
                                      {% endfor %}
                                  {% endif %} 
  
  
                                  &lt;input class=&quot;btn btn-primary d-block w-100&quot; type=&quot;submit&quot; value=&quot;Register&quot;&gt;
                                  
                                  
  
                              &lt;div class=&quot;mb-3&quot;&gt;&lt;/div&gt;
                              &lt;a class=&quot;text-muted&quot; href=&quot;{% url 'login' %}&quot;&gt;Back to Login&lt;/a&gt;
                                  
                              &lt;/form&gt;
  </code></pre>
  <p>I'm not sure what else I can do to get the Form to offer error message to the user if the date is entered incorrectly.</p>