Skip to content

Commit

Permalink
Little bugfix in login js and jsp
Browse files Browse the repository at this point in the history
  • Loading branch information
ms@Nicro authored and ms@Nicro committed Jan 11, 2024
1 parent b650afe commit 7e8fe22
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 48 deletions.
47 changes: 0 additions & 47 deletions src/main/webapp/JS/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,19 +90,6 @@ $(document).ready(function startUp() {
});
});


$("#showPassword").click(function (event){
togglePassword(event);

});
$("#hidePassword").click(function (event){
event.preventDefault();
togglePassword(event);
});

$("#email").blur(function (){
checkRegexEmail();
});
});

function togglePassword(event) {
Expand Down Expand Up @@ -192,37 +179,3 @@ function showError(message) {
newPasswordError.removeClass('error active');
}
}
function togglePassword(event){
event.preventDefault();

const passwordField = $("#password");
let passwordType = passwordField.attr('type');
console.log(passwordType);

if (passwordType === 'password') {
passwordField.attr("type", "text")
} else {
passwordField.attr("type", "password");
}

$("#showPassword").toggle()
$("#hidePassword").toggle()

return NaN
}

function checkRegexEmail() {
const regex = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,}$/;
const emailField = $("#email");

if (regex.test(emailField.val())) {
$("#validEmail").show()
$("#invalidEmail").hide()

} else {
$("#validEmail").hide()
$("#invalidEmail").show()
}

return NaN
}
2 changes: 1 addition & 1 deletion src/main/webapp/JSP/login.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
</div>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js" integrity="sha384-ZvpUoO+Mizj6ZYZZfecO8RR+pL4eZzZ5gA2a5Ha0wjM6un6NIS8YCkK6ZL8SkkD6" crossorigin="anonymous"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js" integrity="sha384-ZvpUoO/+PpLXR1lu4jmpXWu80pZlYUAfxl5NsBMWOEPSjUn/6Z/hRTt8+pR6L4N2" crossorigin="anonymous"></script>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script>
<script src="../JS/login.js"></script>
Expand Down

0 comments on commit 7e8fe22

Please sign in to comment.