title: Thymeleaf Validation
body: <p>I am learning thymeleaf validation section and i got error like</p>
  
  <p><strong>Exception evaluating SpringEL expression: "#fields.hasErrors('jobtitle')" (authentication/contactus:19)</strong></p>
  
  <p>My form has following field</p>
  
  <p>
              </p>
  
  <pre><code>        &lt;div class="form50"&gt;
              &lt;label for="contact.emailAddress"&gt;&lt;span th:text="#{contact.email}"&gt;Email&lt;/span&gt;&lt;/label&gt;
               &lt;span class="error" th:if="${#fields.hasErrors('email')}" th:errors="email"&gt;&lt;/span&gt;
              &lt;input type="email" th:field="*{email}" class="field50" th:classappend="${#fields.hasErrors('email')}? 'fieldError'" /&gt;
          &lt;/div&gt;
  
          &lt;div class="form50"&gt;
              &lt;label for="customer.firstName"&gt;&lt;span th:text="#{contact.jobtitle}"&gt;Job Title&lt;/span&gt;&lt;/label&gt;
              &lt;span class="error" th:if="${#fields.hasErrors('jobtitle')}" th:errors="*{jobtitle}"&gt;&lt;/span&gt;
              &lt;input type="text" th:field="*{jobtitle}" class="field50" th:classappend="${#fields.hasErrors('name')}? 'fieldError'" /&gt;
          &lt;/div&gt;
  
          &lt;div class="login_register"&gt;
              &lt;input class="register_button big red" type="submit" th:value="#{contact.contact}"/&gt;
          &lt;/div&gt;
  
      &lt;/blc:form&gt;
  </code></pre>
  
  <p>when i remove jobtitle div its working fine</p>
  
  <p>myvalidator class looks like following</p>
  
  <pre><code>public void validate(Object obj, Errors errors, boolean useEmailForUsername) {
          ContactCustomerForm form = (ContactCustomerForm) obj;
          ValidationUtils.rejectIfEmptyOrWhitespace(errors, "name", "name.required");
          ValidationUtils.rejectIfEmptyOrWhitespace(errors, "email", "emial.required");
          ValidationUtils.rejectIfEmptyOrWhitespace(errors, "jobtitle", "jobtitle.required");
          ValidationUtils.rejectIfEmptyOrWhitespace(errors, "country", "country.required");
          ValidationUtils.rejectIfEmptyOrWhitespace(errors, "phone", "phone.required");
  }
  </code></pre>
  
  <p>What is the issue i cant able to identify!!!!!!Please Help</p>