-
Notifications
You must be signed in to change notification settings - Fork 127
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 #192 from itzz-keerthi/master
Added user registration form
- Loading branch information
Showing
3 changed files
with
161 additions
and
0 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,50 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>User Registration</title> | ||
<link rel="stylesheet" href="keerthana.css"> | ||
</head> | ||
<body> | ||
<div class="container"> | ||
<div class="form-box"> | ||
<h2>Login</h2> | ||
<form id="loginForm"> | ||
<div class="input-group"> | ||
<label for="loginEmail">Email</label> | ||
<input type="email" id="loginEmail" required> | ||
</div> | ||
<div class="input-group"> | ||
<label for="loginPassword">Password</label> | ||
<input type="password" id="loginPassword" required> | ||
</div> | ||
<button type="submit">Login</button> | ||
<p class="error-message" id="loginError"></p> | ||
</form> | ||
</div> | ||
|
||
<div class="form-box"> | ||
<h2>Sign Up</h2> | ||
<form id="signUpForm"> | ||
<div class="input-group"> | ||
<label for="signUpEmail">Email</label> | ||
<input type="email" id="signUpEmail" required> | ||
</div> | ||
<div class="input-group"> | ||
<label for="signUpPassword">Password</label> | ||
<input type="password" id="signUpPassword" required> | ||
</div> | ||
<div class="input-group"> | ||
<label for="confirmPassword">Confirm Password</label> | ||
<input type="password" id="confirmPassword" required> | ||
</div> | ||
<button type="submit">Sign Up</button> | ||
<p class="error-message" id="signUpError"></p> | ||
</form> | ||
</div> | ||
</div> | ||
|
||
<script src="keerthana.js"></script> | ||
</body> | ||
</html> |
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,38 @@ | ||
document.getElementById('loginForm').addEventListener('submit', function(e) { | ||
e.preventDefault(); | ||
|
||
const email = document.getElementById('loginEmail').value; | ||
const password = document.getElementById('loginPassword').value; | ||
const errorMessage = document.getElementById('loginError'); | ||
|
||
// Basic validation | ||
if (email === '' || password === '') { | ||
errorMessage.innerText = 'All fields are required!'; | ||
errorMessage.style.display = 'block'; | ||
} else { | ||
errorMessage.style.display = 'none'; | ||
alert('Login Successful!'); | ||
} | ||
}); | ||
|
||
document.getElementById('signUpForm').addEventListener('submit', function(e) { | ||
e.preventDefault(); | ||
|
||
const email = document.getElementById('signUpEmail').value; | ||
const password = document.getElementById('signUpPassword').value; | ||
const confirmPassword = document.getElementById('confirmPassword').value; | ||
const errorMessage = document.getElementById('signUpError'); | ||
|
||
// Basic validation | ||
if (email === '' || password === '' || confirmPassword === '') { | ||
errorMessage.innerText = 'All fields are required!'; | ||
errorMessage.style.display = 'block'; | ||
} else if (password !== confirmPassword) { | ||
errorMessage.innerText = 'Passwords do not match!'; | ||
errorMessage.style.display = 'block'; | ||
} else { | ||
errorMessage.style.display = 'none'; | ||
alert('Sign Up Successful!'); | ||
} | ||
}); | ||
|
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,73 @@ | ||
* { | ||
margin: 0; | ||
padding: 0; | ||
box-sizing: border-box; | ||
font-family: Arial, sans-serif; | ||
} | ||
|
||
body { | ||
background-color: #f7f7f7; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
height: 100vh; | ||
} | ||
|
||
.container { | ||
display: flex; | ||
gap: 20px; | ||
} | ||
|
||
.form-box { | ||
background-color: #fff; | ||
padding: 20px; | ||
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); | ||
border-radius: 8px; | ||
width: 300px; | ||
} | ||
|
||
h2 { | ||
margin-bottom: 20px; | ||
color: #333; | ||
} | ||
|
||
.input-group { | ||
margin-bottom: 15px; | ||
} | ||
|
||
.input-group label { | ||
display: block; | ||
margin-bottom: 5px; | ||
color: #333; | ||
} | ||
|
||
.input-group input { | ||
width: 100%; | ||
padding: 10px; | ||
border: 1px solid #ddd; | ||
border-radius: 4px; | ||
font-size: 16px; | ||
} | ||
|
||
button { | ||
width: 100%; | ||
padding: 10px; | ||
background-color: #28a745; | ||
color: white; | ||
border: none; | ||
border-radius: 4px; | ||
font-size: 16px; | ||
cursor: pointer; | ||
} | ||
|
||
button:hover { | ||
background-color: #218838; | ||
} | ||
|
||
.error-message { | ||
color: red; | ||
font-size: 14px; | ||
margin-top: 10px; | ||
display: none; | ||
} | ||
|