Key Features:
1. Modern Gradient Design:
- Attractive header with gradient background
- Gradient button that stands out
- Subtle shadows for depth
2. Responsive Layout:
- Adapts to all screen sizes
- Form fields stack on mobile
- Comfortable padding at all sizes
3. User-Friendly Form:
- Clear labels and inputs
- Proper form validation
- Success feedback after submission
- "Add another" option for quick multiple entries
4. Practical Fields:
Name, contact info
Ticket type dropdown
Arrival time picker
Notes field for additional info
5. Simple Integration:
- Form data captured in JavaScript object
- Ready to connect to your backend
- Console logs data for testing
To implement this form:
- Copy the entire code
- Add to your event management system
- Customize the fields as needed
- Connect to your database/backend (replace the console.log with actual data submission)
The form includes all the essential fields for event visitor tracking while maintaining a clean, professional appearance.
:root {
--primary: #6a11cb;
--secondary: #2575fc;
--light: #f8f9fa;
--dark: #343a40;
--success: #28a745;
--shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
body {
background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
min-height: 100vh;
display: flex;
justify-content: center;
align-items: center;
padding: 20px;
}
.container {
width: 100%;
max-width: 800px;
background: white;
border-radius: 15px;
box-shadow: var(--shadow);
overflow: hidden;
}
.form-header {
background: linear-gradient(to right, var(--primary), var(--secondary));
color: white;
padding: 25px;
text-align: center;
}
.form-header h1 {
font-size: 1.8rem;
margin-bottom: 5px;
}
.form-body {
padding: 30px;
}
.form-group {
margin-bottom: 20px;
}
.form-group label {
display: block;
margin-bottom: 8px;
font-weight: 600;
color: var(--dark);
}
.form-control {
width: 100%;
padding: 12px 15px;
border: 1px solid #ddd;
border-radius: 8px;
font-size: 1rem;
transition: all 0.3s ease;
}
.form-control:focus {
outline: none;
border-color: var(--primary);
box-shadow: 0 0 0 3px rgba(106, 17, 203, 0.1);
}
.btn {
display: inline-block;
background: linear-gradient(to right, var(--primary), var(--secondary));
color: white;
border: none;
padding: 12px 25px;
border-radius: 8px;
cursor: pointer;
font-size: 1rem;
font-weight: 600;
transition: all 0.3s ease;
box-shadow: var(--shadow);
}
.btn:hover {
transform: translateY(-2px);
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}
.btn-block {
display: block;
width: 100%;
}
.form-row {
display: flex;
flex-wrap: wrap;
margin: 0 -10px;
}
.form-col {
flex: 1;
min-width: 200px;
padding: 0 10px;
}
.success-message {
display: none;
text-align: center;
padding: 30px;
}
.success-message i {
font-size: 3rem;
color: var(--success);
margin-bottom: 15px;
}
.success-message h2 {
margin-bottom: 10px;
color: var(--dark);
}
@media (max-width: 576px) {
.form-header h1 {
font-size: 1.5rem;
}
.form-body {
padding: 20px;
}
.form-col {
flex: 100%;
margin-bottom: 15px;
}
}
document.getElementById('visitorForm').addEventListener('submit', function(e) {
e.preventDefault();
// Get form values
const visitorData = {
firstName: document.getElementById('firstName').value,
lastName: document.getElementById('lastName').value,
email: document.getElementById('email').value,
phone: document.getElementById('phone').value,
ticketType: document.getElementById('ticketType').value,
arrivalTime: document.getElementById('arrivalTime').value,
notes: document.getElementById('notes').value,
timestamp: new Date().toISOString()
};
// In a real app, you would send this data to your server
console.log('Visitor data:', visitorData);
// Here you would typically send data to your backend
// For demo purposes, we'll just show success message
document.getElementById('visitorForm').style.display = 'none';
document.getElementById('successMessage').style.display = 'block';
});
document.getElementById('addAnother').addEventListener('click', function() {
document.getElementById('visitorForm').reset();
document.getElementById('visitorForm').style.display = 'block';
document.getElementById('successMessage').style.display = 'none';
});
إرسال تعليق
Thank you
Learning robo team