Dropdown List dependent from previous field

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Dropdown List dependent from previous field

lukass211
Hello All ,

I using Spring Boot  MVC  -->  Class  "Order" and "Client"  there is relation one to many etc...

and now working with Thymeleaf  when creating an "Order form"  , I am choosing from list Client Name
and I would like to have second field automatically filled by  Client  City ( th:value="${client.city}"),
or just display it as Label .

No idea how to do it , any suggestions is welcome

Thanks in advance  
Lukass211




<div th:class="form-group" th:classappend="${#fields.hasErrors('client')}? 'has-error'">
     <label class="col-sm-2 control-label"> Client *</label>
   <div class="col-md-10">
                       
  <select class="form-control" th:field="*{client}">
        <option value=""> Select Client</option>
        <option th:each="client : ${allklient}" th:value="${client.id}"  th:text="${client.name}"> </option>
  </select>
                       
Client Errors

        </div>

 </div>       

Loading...