Skip to content

Commit

Permalink
fix: removed checkbox
Browse files Browse the repository at this point in the history
  • Loading branch information
upsaurav12 committed Mar 7, 2024
1 parent c4205a3 commit 2769d2d
Showing 1 changed file with 9 additions and 15 deletions.
24 changes: 9 additions & 15 deletions app/views/users/sessions/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -65,33 +65,27 @@
</div>
</div>
<script>
document.addEventListener("DOMContentLoaded", function() {
document.addEventListener("DOMContentLoaded", function () {
let emailInput = document.querySelector(".user-email-input");
let passwordInput = document.querySelector(".users-password-input");
let loginButton = document.querySelector(".users-login-primary-button");
let checkbox = document.querySelector(".primary-checkpoint")

toggledButton = () => {

let emailInputValue = emailInput.value.trim();
let passwordInputValue = passwordInput.value.trim();

let isChecked = false;

checkbox.addEventListener("click", () => {
isChecked = !isChecked;

if(emailInputValue !== "" && passwordInputValue !== "" && isChecked)
if (emailInputValue !== "" && passwordInputValue !== "") {
loginButton.disabled = false;
else
loginButton.disabled = true;
})
}
}
};

emailInput.addEventListener("input", toggledButton);
passwordInput.addEventListener("input", toggledButton);
});

document.querySelector(".users-forgot-password-text").addEventListener('click', () => {
localStorage.setItem('Email', querySelector(".user-email-input").val());
localStorage.setItem('Email', document.querySelector(".user-email-input").value);
});
});

</script>
<script src="/js/togglePassword.js"></script>

0 comments on commit 2769d2d

Please sign in to comment.