register already known persons
This commit is contained in:
@ -17,6 +17,16 @@
|
||||
<input type="hidden" th:field="*{fkCamp}" />
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-sm-12 rowdist" th:if="${wellknown}">
|
||||
<div class="dropdown">
|
||||
<button class="btn btn-outline-secondary dropdown-toggle form-control" type="button" data-bs-toggle="dropdown" aria-expanded="false">
|
||||
aus bisherigen Anmeldungen vorbefüllen
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
<li th:each="w : ${wellknown}"><a class="dropdown-item" href="#" th:attr="onclick=|useexisting('${w.json}')|"><span
|
||||
th:text="${w.option}"></span></a></li>
|
||||
</ul>
|
||||
</div> </div>
|
||||
<div class="col-sm-6 rowdist">
|
||||
<div>Vorname</div>
|
||||
<input type="text" th:field="*{forename}" th:class="${'form-control ' + (#fields.hasErrors('forename') ? 'inputerror' : '')}" />
|
||||
@ -122,6 +132,20 @@
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
function useexisting(o) {
|
||||
j = JSON.parse(o);
|
||||
$("#forename").val(j.forename);
|
||||
$("#surname").val(j.surname);
|
||||
$("#street").val(j.street);
|
||||
$("#zip").val(j.zip);
|
||||
$("#city").val(j.city);
|
||||
$("#phone").val(j.phone);
|
||||
$("#email").val(j.email);
|
||||
$("#sex").val(j.sex);
|
||||
$("#birthDate").val(j.birthDate);
|
||||
}
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user