From 189876d583aec321e66d42a6f12f7ac6ffe06ee5 Mon Sep 17 00:00:00 2001
From: adityamanapure <137915305+adityamanapure@users.noreply.github.com>
Date: Sun, 27 Oct 2024 12:41:43 +0530
Subject: [PATCH] Update login.html
added success message on login
---
Html-files/login.html | 74 +++++++++++++++++++++++++------------------
1 file changed, 43 insertions(+), 31 deletions(-)
diff --git a/Html-files/login.html b/Html-files/login.html
index fa220990..268dee1e 100644
--- a/Html-files/login.html
+++ b/Html-files/login.html
@@ -387,36 +387,7 @@
LOGIN
animateCircles();
- // Form submission event listener
- document.getElementById('loginForm').addEventListener('submit', function(event) {
- // Prevent form submission
- event.preventDefault();
-
- // Get the input values
- const emailInput = document.getElementById('email').value;
- const passwordInput = document.getElementById('password').value;
-
- // Regular expression for email validation (simple check)
- const emailPattern = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
-
- // Password validation (at least 8 characters)
- const isValidPassword = passwordInput.length >= 8;
-
- // Clear previous error message
- document.getElementById('error-message').textContent = '';
-
- // Validate the email and password separately
- if (!emailPattern.test(emailInput)) {
- // Display an error message if the email format is incorrect
- document.getElementById('error-message').textContent = 'Invalid email format.';
- } else if (!isValidPassword) {
- // Display an error message if the password is too short
- document.getElementById('error-message').textContent = 'Password must be at least 8 characters.';
- } else {
- // If both are valid, redirect to logged.html
- window.location.assign('logged.html');
- }
- });
+
// Toggle password visibility
function togglePasswordVisibility() {
@@ -433,6 +404,47 @@ LOGIN
}
}
+
+
+
+