Added success message when you change credentials

Added "see password" button - With CSS & Script (Script in file)
This commit is contained in:
Anders
2020-07-31 09:28:58 +02:00
parent 38f8bfa0c9
commit 56cbe7ad41
5 changed files with 35 additions and 6 deletions
@@ -7,18 +7,38 @@
@section("content")
<main>
<h1 class="text-center sde-blue mt-0">Konto</h1>
<form method="post" action="{{ route("users.update", ['user' => Auth::user()]) }}">
<form method="post" action="{{ route("users.update", ['user' => Auth::user()]) }}" style="display: block;">
@csrf
@method("put")
<span>Nuværende Password:</span>
<input type="password" name="oldpassword" id="old" required>
<input type="password" name="oldpassword" id="old" placeholder="******" required style="width: calc(100% - 12px)">
<span toggle="#password-field" class="fa fa-fw fa-eye field-icon toggle-password spaneye" id="fa-old" onclick="show('old', 'fa-old')"></span>
<span>Nyt Password:</span>
<input type="password" name="password" id="new" required>
<input class="w-100" type="password" name="password" id="new" placeholder="******" required style="width: calc(100% - 12px)">
<span toggle="#password-field" class="fa fa-fw fa-eye field-icon toggle-password spaneye" id="fa-new" onclick="show('new', 'fa-new')"></span>
<span>Bekræft Nyt Password:</span>
<input type="password" name="confirmpassword" id="confirm" required>
<input class="w-100" type="password" name="confirmpassword" id="confirm" placeholder="******" required style="width: calc(100% - 12px)">
<span toggle="#password-field" class="fa fa-fw fa-eye field-icon toggle-password spaneye" id="fa-confirm" onclick="show('confirm', 'fa-confirm')"></span>
{!! session()->get('error#notsamepass') !!}
{!! session()->get('error#oldpass') !!}
<button type="submit" class="btn text-center btn-sde-blue mt-1">Rediger</button>
</form>
</main>
@endsection
@section("scripts")
<script>
function show($passID, $faID) {
var inputPass = document.getElementById($passID);
var faEye = document.getElementById($faID);
if (inputPass.type === "password") {
inputPass.type = "text";
faEye.style.color = "#000";
} else {
inputPass.type = "password";
faEye.style.color = "#808080";
}
}
</script>
@endsection