User Edit HTML Select/Option Box

This commit is contained in:
TorstenS 2020-09-24 11:24:48 +02:00
parent 9c8184ecdd
commit f7c6df6b87

View file

@ -17,22 +17,15 @@
<input type="text" class="mt-3 mr-2 form-control" id="lastname" style="font-size:20px;" name="email" value="{{ $user->email }}" required >
</div>
<div class="form-group" style="display:flex;">
<label class="ml-2 mt-4" style="width:130px; text-align:left;" for="name" ><h4>Rolle:</h4></label>
<div class="dropdown mt-3">
<button class="btn btn-secondary dropdown-toggle bg-light text-dark" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
{{$user->role}}
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<a class="dropdown-item" onclick="setRole('GUEST');return false;">GUEST</a>
<a class="dropdown-item" onclick="setRole('MEMBER');return false;">MEMBER</a>
<a class="dropdown-item" onclick="setRole('ADMIN');return false;">ADMIN</a>
</div>
</div>
<select name="example" class="dropdown-item ml-3 border form-control mt-3 mr-2" style="font-size:18px;">
<option value="A" style="font-size:18px;" class="dropdown-item bg-light form-control">A</option>
<option value="B" style="font-size:18px;" class="dropdown-item bg-light">B</option>
<option value="-" style="font-size:18px;" class="dropdown-item bg-light">Other</option>
</select>
</div>
@if(Auth::user()->role=="ADMIN")
@ -43,15 +36,5 @@
</form>
</div>
<script>
global_role={!! $user->role !!};
function setRole($role) {
document.getElementById("dropdownMenuButton").innerHTML=$role;
global_role = $role;
//console.log("Setting role="+$role)
}
</script>
@endsection