title: How to add default values for Thymeleaf input fields?
body: <p>Here is my thymeleaf form input field. I want to set a default value for that. Suppose I want set "individual" as default value. how to do that?   </p>
  
  <pre><code> &lt;div class="col-sm-9"&gt;
                              &lt;label th:if="${#fields.hasErrors('priceSearchDTO.partyType')}" th:errors="*{priceSearchDTO.partyType}"
                                     class="validation-message"&gt;&lt;/label&gt;
                              &lt;input type="text" th:field="*{priceSearchDTO.partyType}" placeholder="partyType"
                                     class="form-control"/&gt;
                          &lt;/div&gt;
  </code></pre>
  
  <p>Additionally I tried with this, But it doesn't work as normal html field.</p>
  
  <pre><code>&lt;div class="col-sm-9"&gt;
                          &lt;label th:if="${#fields.hasErrors('priceSearchDTO.partyType')}" th:errors="*{priceSearchDTO.partyType}"
                                 class="validation-message"&gt;&lt;/label&gt;
                          &lt;input type="text" th:field="*{priceSearchDTO.partyType}" placeholder="partyType" value="individual"
                                 class="form-control"/&gt;
                      &lt;/div&gt;
  </code></pre>