Modern Event Visitor Entry Registration Form Using Html Css and Javascript

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:

  1. Copy the entire code
  2. Add to your event management system
  3. Customize the fields as needed
  4. 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.

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Event Visitor Registration</title> </head> <body> <div class="container"> <div class="form-header"> <h1>Event Visitor Registration</h1> <p>Enter visitor details below</p> </div> <form id="visitorForm" class="form-body"> <div class="form-row"> <div class="form-col"> <div class="form-group"> <label for="firstName">First Name</label> <input type="text" id="firstName" class="form-control" required> </div> </div> <div class="form-col"> <div class="form-group"> <label for="lastName">Last Name</label> <input type="text" id="lastName" class="form-control" required> </div> </div> </div> <div class="form-group"> <label for="email">Email Address</label> <input type="email" id="email" class="form-control" required> </div> <div class="form-group"> <label for="phone">Phone Number</label> <input type="tel" id="phone" class="form-control" required> </div> <div class="form-row"> <div class="form-col"> <div class="form-group"> <label for="ticketType">Ticket Type</label> <select id="ticketType" class="form-control" required> <option value="" disabled selected>Select ticket type</option> <option value="general">General Admission</option> <option value="vip">VIP</option> <option value="press">Press</option> <option value="speaker">Speaker</option> </select> </div> </div> <div class="form-col"> <div class="form-group"> <label for="arrivalTime">Arrival Time</label> <input type="time" id="arrivalTime" class="form-control" required> </div> </div> </div> <div class="form-group"> <label for="notes">Additional Notes</label> <textarea id="notes" class="form-control" rows="3"></textarea> </div> <button type="submit" class="btn btn-block">Register Visitor</button> </form> <div class="success-message" id="successMessage"> <i>✓</i> <h2>Registration Successful!</h2> <p>Visitor details have been recorded.</p> <button class="btn" id="addAnother" style="margin-top: 20px;">Add Another Visitor</button> </div> </div> </body> </html>
CSS provides style to an HTML page. To make the page attractive create a CSS file with the name style.css and remember that you have to make a file with a .css extension.


: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;
            }
        }
JavaScript makes the page work functionally. At last, create a JavaScript file with the name of script.js, and remember that you've got to make a file with a .js extension.


    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

Post a Comment

Thank you
Learning robo team

Post a Comment (0)

Previous Post Next Post
Learning Robo says...
code copied
Welcome