Skip to content

Commit

Permalink
Create contact.html
Browse files Browse the repository at this point in the history
  • Loading branch information
MJ-AHMAD authored Jan 10, 2025
1 parent 5c26e53 commit e8ecaca
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions contact.html
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>

0 comments on commit e8ecaca

Please sign in to comment.