Skip to content

Commit

Permalink
Update register.blade.php
Browse files Browse the repository at this point in the history
  • Loading branch information
mohamadarif03 committed Jan 5, 2025
1 parent a25151b commit 75e2ef1
Showing 1 changed file with 27 additions and 25 deletions.
52 changes: 27 additions & 25 deletions resources/views/auth/register.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class="border-top w-100 position-absolute top-50 start-50 translate-middle"></sp
<form id="register-form">
<div class="input-group mb-3">
<button class="btn"
style="background-color: #F3F3F3;border-radius: 12px 0px 0px 12px"
style="background-color: #F3F3F3; border-radius: 12px 0px 0px 12px"
type="button">
<svg xmlns="http://www.w3.org/2000/svg" width="25" height="15"
viewBox="-5 -2 24 24">
Expand Down Expand Up @@ -178,11 +178,12 @@ class="border-top w-100 position-absolute top-50 start-50 translate-middle"></sp
style="background-color: #9425FE;border-radius: 10px;">
Buat Akun
</button>
<div class="text-center mt-2">
<p style="color: #989898;">Sudah punya akun? <a href="{{ route('login') }}"
style="color: #9425FE">Masuk sekarang</a></p>
<div class="d-flex justify-content-center">
<p class="text-center mt-4" style="font-size: 14px;">Sudah Punya Akun? <a
href="{{ route('login') }}" style="color: #6A42F4;">Masuk</a></p>
</div>
</form>

</div>
</div>
</div>
Expand Down Expand Up @@ -233,30 +234,31 @@ class="border-top w-100 position-absolute top-50 start-50 translate-middle"></sp
let errors = error.responseJSON.data || {};
let message = error.responseJSON.meta.message;
// Reset status is-invalid
$('#email, #password').removeClass('is-invalid');
$('#email, #password, #name, #password_confirmation').removeClass(
'is-invalid');
// Tampilkan pesan error pada field yang memiliki error
if (errors.email) {
$('#email').addClass('is-invalid')
.next('.invalid-feedback').text(errors.email[0]);
}
if (errors.name) {
$('#name').addClass('is-invalid')
.next('.invalid-feedback').text(errors.name[0]);
}
if (errors.password) {
$('#password').addClass('is-invalid')
.next('.invalid-feedback').text(errors.password[0]);
}
if (errors.password_confirmation) {
$('#password_confirmation').addClass('is-invalid')
.next('.invalid-feedback').text(errors.password_confirmation[
0]);
}
// Tampilkan pesan error pada field email dan password jika ada
if (errors.email || errors.name || errors.password || errors
if (!errors.email && !errors.name && !errors.password && !errors
.password_confirmation) {
if (errors.email) {
$('#name').addClass('is-invalid')
.next('.invalid-feedback').text(errors.name[0]);
}
if (errors.email) {
$('#email').addClass('is-invalid')
.next('.invalid-feedback').text(errors.email[0]);
}
if (errors.password) {
$('#password').addClass('is-invalid')
.next('.invalid-feedback').text(errors.password[0]);
}
if (errors.password) {
$('#password_confirmation').addClass('is-invalid')
.next('.invalid-feedback').text(errors.password[0]);
}
} else {
$('#email, #password').addClass('is-invalid')
.next('.invalid-feedback').text(message);
}
Expand Down

0 comments on commit 75e2ef1

Please sign in to comment.