Skip to content

Commit

Permalink
focus label function
Browse files Browse the repository at this point in the history
  • Loading branch information
akashTharuka committed Mar 13, 2021
1 parent 52dbb89 commit 10d93d8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions public/assets/javascript/formController.js
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,7 @@ function submitPin(){
}

function focusLabel(element){
// console.log("clicked");
let formControl = element.parentElement;
formControl.querySelector('input').focus();
}
Expand Down
6 changes: 3 additions & 3 deletions public/change_password.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<div class="form-control">

<input type="password" name="current_password" class="existingPsw changePsw" id="current_password" placeholder="Enter current password">
<label for="password" class="form-label">Current password</label>
<label for="password" class="form-label" onclick="focusLabel(this)">Current password</label>
<i class="far fa-eye" id="togglePassword"></i>
<i class="fa fa-check-circle"></i>
<i class="fa fa-exclamation-circle"></i>
Expand All @@ -42,7 +42,7 @@
<div class="form-control">

<input type="password" name="new_password" class="newPsw changePsw psw" id="new_password" placeholder="Enter new password">
<label for="password" class="form-label">New password</label>
<label for="password" class="form-label" onclick="focusLabel(this)">New password</label>
<i class="far fa-eye" id="togglePassword"></i>
<i class="fa fa-check-circle"></i>
<i class="fa fa-exclamation-circle"></i>
Expand All @@ -52,7 +52,7 @@
<div class="form-control">

<input type="password" name="confirm_password" class="newPsw changePsw confirm" id="confirm_password" placeholder="Cofirm new password">
<label for="password" class="form-label">Confirm new password</label>
<label for="password" class="form-label" onclick="focusLabel(this)">Confirm new password</label>
<i class="far fa-eye" id="togglePassword"></i>
<i class="fa fa-check-circle"></i>
<i class="fa fa-exclamation-circle"></i>
Expand Down

0 comments on commit 10d93d8

Please sign in to comment.