JAVASCRIPT SMALL FUNCTIONALITY
CHECKOUT LIST WITH OUT SELECT DELETE BUTTON CLICK THEN VALIDATION.
function checkdel(){
val = confirm('Are you sure want to delete?');
if(val){
var checkedCount = $('input[class="chskbox"]:checked').length;
if(checkedCount > 0)
return true;
}
return false;
}
SHOW PASSWORD VIEW BUTTON FUNCTIONALITY
<form role="form" method="POST" action="{{ route('pub.change-password') }}">
{{ csrf_field() }}
<div class="row">
<div class="col-md-6">
<div class="form-group{{ $errors->has('old_password') ? ' has-error' : '' }}">
<label>Current Password</label>
<div class="input-group mb-3">
<input id="old_password" type="password" class="form-control @error('old_password') is-invalid @enderror" name="old_password" required>
<div class="input-group-append">
<div class="input-group-text" onclick="showPassword()">
<span class="fas fa-eye" id="eye"></span>
</div>
</div>
</div>
@if ($errors->has('old_password'))
<span class="help-block">
<div class="text-danger">
<strong class="text-danger font-italic">{{ $errors->first('old_password') }}</strong>
</div>
</span>
@endif
</div>
<!-- /.form-group -->
<div class="form-group{{ $errors->has('new_password') ? ' has-error' : '' }}">
<label>New Password</label>
<div class="input-group mb-3">
<input id="new_password" type="password" class="form-control @error('new_password') is-invalid @enderror" name="new_password" required>
<div class="input-group-append">
<div class="input-group-text" onclick="show_new_Password()">
<span class="fas fa-eye" id="new_eye"></span>
</div>
</div>
</div>
@if ($errors->has('new_password'))
<span class="help-block">
<div class="text-danger font-italic"> <strong class="text-danger">{{ $errors->first('new_password') }}</strong></div>
</span>
@endif
</div>
<div class="form-group">
<label>Confirm New Password</label>
<div class="input-group mb-3">
<input id="new-password-confirm" type="password" class="form-control @error('confirm_password') is-invalid @enderror" name="confirm_password" required>
{{-- <input type="password" name="password" class="@error('password') is-invalid @enderror form-control" placeholder="Password" id="password"> --}}
<div class="input-group-append">
<div class="input-group-text" onclick="show_conf_Password()">
<span class="fas fa-eye" id="conf_eye"></span>
</div>
</div>
</div>
{{-- <input id="new-password-confirm" type="password" class="form-control" name="new-password_confirmation" required> --}}
@if ($errors->has('confirm_password'))
<span class="help-block">
<div class="text-danger font-italic"> <strong class="text-danger">{{ $errors->first('confirm_password') }}</strong></div>
</span>
@endif
</div>
<button type="submit" class="btn btn-primary">
Change Password
</button>
</div>
<!-- /.col -->
<!-- <div class="col-md-6">
<div class="form-group">
<label>Multiple</label>
</div>
</div> -->
<!-- /.col -->
</div>
</form>
<script type="text/javascript">
function showPassword() {
var x = document.getElementById("old_password");
if (x.type === "password") {
x.type = "text";
$("#eye").removeClass('fa fa-eye');
$("#eye").addClass('fa fa-eye-slash');
} else {
x.type = "password";
$("#eye").removeClass('fa fa-eye-slash');
$("#eye").addClass('fa fa-eye');
}
}
function show_new_Password() {
var x = document.getElementById("new_password");
if (x.type === "password") {
x.type = "text";
$("#new_eye").removeClass('fa fa-eye');
$("#new_eye").addClass('fa fa-eye-slash');
} else {
x.type = "password";
$("#new_eye").removeClass('fa fa-eye-slash');
$("#new_eye").addClass('fa fa-eye');
}
}
function show_conf_Password() {
var x = document.getElementById("new-password-confirm");
if (x.type === "password") {
x.type = "text";
$("#conf_eye").removeClass('fa fa-eye');
$("#conf_eye").addClass('fa fa-eye-slash');
} else {
x.type = "password";
$("#conf_eye").removeClass('fa fa-eye-slash');
$("#conf_eye").addClass('fa fa-eye');
}
}
</script>
Comments
Post a Comment