-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #60 from Anupkjha2601/revert-50-main
Revert "Fixes Issue #49: Updated Log in and Sign-Up pages for better UI and also Optimized code for various sections."
- Loading branch information
Showing
9 changed files
with
435 additions
and
478 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
const loginForm = document.getElementById("login-form"); | ||
const loginButton = document.getElementById("login-form-submit"); | ||
const loginErrorMsg = document.getElementById("login-error-msg"); | ||
|
||
// When the login button is clicked, the following code is executed | ||
loginButton.addEventListener("click", (e) => { | ||
// Prevent the default submission of the form | ||
e.preventDefault(); | ||
// Get the values input by the user in the form fields | ||
const username = loginForm.username.value; | ||
const password = loginForm.password.value; | ||
|
||
if (username === "user" && password === "web_dev") { | ||
// If the credentials are valid, show an alert box and redirect to about.html | ||
// alert("You have successfully logged in."); | ||
window.location.href = 'about.html'; // Redirect to about.html after successful login | ||
} else { | ||
// Otherwise, make the login error message show | ||
loginErrorMsg.style.opacity = 1; | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.