This commit is contained in:
Donald Cheng Hong Zou
2022-01-24 20:11:35 -05:00
parent af71176296
commit 377abd87fd
2 changed files with 26 additions and 4 deletions

View File

@@ -37,18 +37,20 @@
{% include "footer.html" %}
<script>
$("button").on("click", function(e){
let req = $("input[required]");
e.preventDefault();
let $password = $("#password");
let $username = $("#username");
let req = [$password, $username];
let check = true
for (let i = 0; i < req.length; i++){
if ($(req[i]).val().length === 0){
$("button").html("Sign In");
check = false;
$("input[required]").addClass("is-invalid");
$(req[i]).addClass("is-invalid");
break;
}
}
if (check){
e.preventDefault();
$(this).html("Signing In...").attr("disabled", "disabled");
$.ajax({
url: "/auth",