-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
57 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,57 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Contact Form</title> | ||
<style> | ||
body { font-family: Arial, sans-serif; background-color: #f4f4f4; } | ||
.container { max-width: 600px; margin: 50px auto; padding: 20px; background: #fff; border-radius: 8px; box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); } | ||
.form-group { margin-bottom: 15px; } | ||
.form-group label { display: block; margin-bottom: 5px; } | ||
.form-group input, .form-group textarea { width: 100%; padding: 10px; box-sizing: border-box; } | ||
.form-group textarea { resize: vertical; } | ||
.btn { background-color: #5cb85c; color: #fff; padding: 10px 20px; border: none; border-radius: 5px; cursor: pointer; } | ||
.btn:hover { background-color: #4cae4c; } | ||
</style> | ||
</head> | ||
<body> | ||
<div class="container"> | ||
<h2>Contact Us</h2> | ||
<form id="contactForm" action="success.html" method="post" onsubmit="submitForm(event)"> | ||
<div class="form-group"> | ||
<label for="name">Name:</label> | ||
<input type="text" id="name" name="name" required> | ||
</div> | ||
<div class="form-group"> | ||
<label for="email">Email:</label> | ||
<input type="email" id="email" name="email" required> | ||
</div> | ||
<div class="form-group"> | ||
<label for="number">Number:</label> | ||
<input type="text" id="number" name="number" required> | ||
</div> | ||
<div class="form-group"> | ||
<label for="details">Details:</label> | ||
<textarea id="details" name="details" rows="5" required></textarea> | ||
</div> | ||
<button type="submit" class="btn">Submit</button> | ||
</form> | ||
</div> | ||
<script> | ||
function submitForm(event) { | ||
event.preventDefault(); | ||
const formData = { | ||
name: document.getElementById('name').value, | ||
email: document.getElementById('email').value, | ||
number: document.getElementById('number').value, | ||
details: document.getElementById('details').value | ||
}; | ||
// Save data to localStorage for admin | ||
localStorage.setItem('formData', JSON.stringify(formData)); | ||
// Redirect to success page | ||
window.location.href = 'success.html'; | ||
} | ||
</script> | ||
</body> | ||
</html> |