buat sekarang
This commit is contained in:
@@ -48,7 +48,7 @@
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="ni ni-lock-circle-open"></i></span>
|
||||
</div>
|
||||
<input class="form-control{{ $errors->has('password') ? ' is-invalid' : '' }}" placeholder="{{ __('Password') }}" type="password" name="password" required>
|
||||
<input id="password" onKeyUp="checkPasswordStrength();" class="form-control{{ $errors->has('password') ? ' is-invalid' : '' }}" placeholder="{{ __('Password') }}" type="password" name="password" required>
|
||||
</div>
|
||||
@if ($errors->has('password'))
|
||||
<span class="invalid-feedback" style="display: block;" role="alert">
|
||||
@@ -61,12 +61,12 @@
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="ni ni-lock-circle-open"></i></span>
|
||||
</div>
|
||||
<input class="form-control" placeholder="{{ __('Confirm Password') }}" type="password" name="password_confirmation" required>
|
||||
<input name="confirm_password" class="form-control" placeholder="{{ __('Confirm Password') }}" type="password" name="password_confirmation" required>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-muted font-italic">
|
||||
<small>{{ __('password strength') }}: <span class="text-success font-weight-700">{{ __('strong') }}</span></small>
|
||||
<small>{{ __('password strength') }}: <span class="text-muted font-weight-700" id="password-strength-status">none</span></small>
|
||||
</div>
|
||||
<div class="row my-4">
|
||||
<div class="col-12">
|
||||
@@ -107,6 +107,41 @@
|
||||
</div>
|
||||
|
||||
<script>
|
||||
|
||||
function checkPasswordStrength() {
|
||||
var number = /([0-9])/;
|
||||
var alphabets = /([a-zA-Z])/;
|
||||
var special_characters = /([~,!,@,#,$,%,^,&,*,-,_,+,=,?,>,<])/;
|
||||
if ($('#password').val().length > 0 && $('#password').val().length < 6) {
|
||||
$('#password-strength-status').removeClass();
|
||||
$('#password-strength-status').addClass('text-danger font-weight-700');
|
||||
$('#password-strength-status').html("Weak (should be atleast 6 characters.)");
|
||||
} else if($('#password').val().length == 0)
|
||||
{
|
||||
$('#password-strength-status').removeClass();
|
||||
$('#password-strength-status').addClass('text-muted font-weight-700');
|
||||
$('#password-strength-status').html("None");
|
||||
} else {
|
||||
if ($('#password').val().match(number) && $('#password').val().match(alphabets) && $('#password').val().match(special_characters)) {
|
||||
$('#password-strength-status').removeClass();
|
||||
$('#password-strength-status').addClass('text-success font-weight-700');
|
||||
$('#password-strength-status').html("Strong");
|
||||
} else {
|
||||
$('#password-strength-status').removeClass();
|
||||
$('#password-strength-status').addClass('text-yellow font-weight-700');
|
||||
$('#password-strength-status').html("Medium (should include alphabets, numbers and special characters.)");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function checkSamePassword()
|
||||
{
|
||||
if($('#password').val() !== $('#confirm_password').val())
|
||||
{
|
||||
console.log('x sama dengan password');
|
||||
}
|
||||
}
|
||||
|
||||
function loading_close(){
|
||||
$('#modal-loading').modal('hide');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user