Setze leere Defaultoptionen

This commit is contained in:
Gonne 2023-11-10 14:12:45 +01:00
parent 3f2b312870
commit 50b9f0c756
2 changed files with 4 additions and 2 deletions

View file

@ -35,6 +35,7 @@
<div class="form-floating mb-3">
<select class="form-control form-select required" required name="veranstaltung" id="veranstaltung">
<option disabled{{if eq $.SelectedCourse 0 }} selected{{end}} value> auswählen </option>
{{range $course := .Courses}}
<option value="{{$course.Id}}"{{if eq $course.Id $.SelectedCourse}} selected{{end}}>{{$course.Name}}</option>
{{end}}
@ -102,6 +103,7 @@
<div class="form-floating mb-3">
<select class="form-control form-select required" required name="raum" id="raum">
<option disabled{{if eq $.SelectedRoom 0 }} selected{{end}} value> auswählen </option>
{{range $room := .Rooms}}
<option value="{{$room.Id}}"{{if eq $room.Id $.SelectedRoom}} selected{{end}}>{{$room.Name}}</option>
{{end}}

View file

@ -14,7 +14,7 @@ Sprechstunden
<div class="input-group mb-3">
<div class="form-floating col-lg-8">
<select class="form-control form-select" name="veranstaltung" id="veranstaltung" size="1" onchange="document.forms[0].submit()">
<option value=""> auswählen </option>
<option disabled selected value> auswählen </option>
{{range $course := .Courses}}
<option value="{{$course.Id}}"{{if eq $course.Id $.SelectedCourse}} selected{{end}}>{{$course.Name}}</option>
{{end}}
@ -30,7 +30,7 @@ Sprechstunden
<div class="input-group mb-3">
<div class="form-floating">
<select class="form-control form-select" name="raum" id="raum" size="1" onchange="document.forms[1].submit()">
<option value=""> auswählen </option>
<option disabled selected value> auswählen </option>
{{range $room := .Rooms}}
<option value="{{$room.Id}}"{{if eq $room.Id $.SelectedRoom}} selected{{end}}>{{$room.Name}}</option>
{{end}}