Penambahan icon mata pada form password web wa
This commit is contained in:
@@ -217,7 +217,12 @@
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Passphrase</label>
|
||||
<div class="input-group">
|
||||
<input type="password" class="form-control" name="passphrase" required>
|
||||
<button type="button" class="btn btn-outline-secondary" id="togglePassphrase" aria-label="Tampilkan passphrase">
|
||||
<i class="fas fa-eye"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex gap-2">
|
||||
<button type="submit" class="btn btn-setujui text-white flex-fill">Kirim Persetujuan</button>
|
||||
@@ -456,6 +461,14 @@
|
||||
|
||||
$('.batal-aksi').on('click', tutupForm);
|
||||
|
||||
$('#togglePassphrase').on('click', function () {
|
||||
const $input = $('#formSetujui [name=passphrase]');
|
||||
const tampil = $input.attr('type') === 'password';
|
||||
$input.attr('type', tampil ? 'text' : 'password');
|
||||
$(this).attr('aria-label', tampil ? 'Sembunyikan passphrase' : 'Tampilkan passphrase')
|
||||
.find('i').toggleClass('fa-eye', !tampil).toggleClass('fa-eye-slash', tampil);
|
||||
});
|
||||
|
||||
$('#formSetujui').on('submit', function (e) {
|
||||
e.preventDefault();
|
||||
const $btn = $(this).find('button[type=submit]');
|
||||
|
||||
Reference in New Issue
Block a user