-
Notifications
You must be signed in to change notification settings - Fork 0
/
log.js
18 lines (15 loc) · 838 Bytes
/
log.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
document.getElementById('loginForm').addEventListener('submit', function(event) {
event.preventDefault(); // Prevent the form from submitting
// Get input values
var username = document.getElementById('username').value;
var password = document.getElementById('password').value;
// Here, you'd typically make an AJAX request to your server to validate the credentials
// For simplicity, let's assume the username is "admin" and password is "password"
if (username === 'admin' && password === 'password') {
document.getElementById('loginMessage').innerText = 'Login successful!';
// Redirect to dashboard or any other page
// window.location.href = 'dashboard.html';
} else {
document.getElementById('loginMessage').innerText = 'Invalid username or password';
}
});