HTML Quiz Form Generator
Build interactive quizzes and assessments
Form Preview
HTML Code
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Form</title>
<style>
body {
font-family: Arial, sans-serif;
line-height: 1.6;
margin: 0;
padding: 20px;
color: #333;
}
.form-container {
max-width: 600px;
margin: 0 auto;
background: #f9f9f9;
padding: 20px;
border-radius: 8px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
.form-group {
margin-bottom: 15px;
}
label {
display: block;
margin-bottom: 5px;
font-weight: bold;
}
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
input[type="date"],
select,
textarea {
width: 100%;
padding: 8px;
border: 1px solid #ddd;
border-radius: 4px;
box-sizing: border-box;
font-size: 16px;
}
textarea {
height: 100px;
}
.checkbox-group, .radio-group {
margin-bottom: 10px;
}
.checkbox-item, .radio-item {
margin-bottom: 5px;
}
button {
background-color: #4CAF50;
color: white;
padding: 10px 15px;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 16px;
}
button:hover {
background-color: #45a049;
}
.required:after {
content: " *";
color: red;
}
</style>
</head>
<body>
<div class="form-container">
<form id="quiz-form" action="#" method="POST">
<div class="form-group">
<label for="name" class="required">Your Name</label>
<input type="text" id="name" name="name" required>
</div>
<div class="form-group">
<label for="email" class="required">Email Address</label>
<input type="email" id="email" name="email" required>
</div>
<div class="form-group">
<label for="question1" class="required">Question 1: What is the capital of France?</label>
<div class="radio-group">
<div class="radio-item">
<input type="radio" id="question1-0" name="question1" value="London" required>
<label for="question1-0">London</label>
</div>
<div class="radio-item">
<input type="radio" id="question1-1" name="question1" value="Berlin" >
<label for="question1-1">Berlin</label>
</div>
<div class="radio-item">
<input type="radio" id="question1-2" name="question1" value="Paris" >
<label for="question1-2">Paris</label>
</div>
<div class="radio-item">
<input type="radio" id="question1-3" name="question1" value="Madrid" >
<label for="question1-3">Madrid</label>
</div>
</div>
</div>
<div class="form-group">
<label for="question2" class="required">Question 2: Which planet is closest to the sun?</label>
<div class="radio-group">
<div class="radio-item">
<input type="radio" id="question2-0" name="question2" value="Earth" required>
<label for="question2-0">Earth</label>
</div>
<div class="radio-item">
<input type="radio" id="question2-1" name="question2" value="Venus" >
<label for="question2-1">Venus</label>
</div>
<div class="radio-item">
<input type="radio" id="question2-2" name="question2" value="Mercury" >
<label for="question2-2">Mercury</label>
</div>
<div class="radio-item">
<input type="radio" id="question2-3" name="question2" value="Mars" >
<label for="question2-3">Mars</label>
</div>
</div>
</div>
<div class="form-group">
<label for="question3" class="required">Question 3: Who painted the Mona Lisa?</label>
<div class="radio-group">
<div class="radio-item">
<input type="radio" id="question3-0" name="question3" value="Van Gogh" required>
<label for="question3-0">Van Gogh</label>
</div>
<div class="radio-item">
<input type="radio" id="question3-1" name="question3" value="Picasso" >
<label for="question3-1">Picasso</label>
</div>
<div class="radio-item">
<input type="radio" id="question3-2" name="question3" value="Da Vinci" >
<label for="question3-2">Da Vinci</label>
</div>
<div class="radio-item">
<input type="radio" id="question3-3" name="question3" value="Michelangelo" >
<label for="question3-3">Michelangelo</label>
</div>
</div>
</div>
<div class="form-group">
<button type="submit">Submit</button>
</div>
</form>
</div>
<script>
document.getElementById('quiz-form').addEventListener('submit', function(e) {
e.preventDefault();
console.log('Form submitted');
// You would typically send the form data to a server here
alert('Form submitted successfully!');
});
</script>
</body>
</html>
Installation
How to setup HTML Quiz form
- 1
Sign up to parrotforms.com
Create your first form API endpoint then copy your endpoint.
Screenshot Placeholder - 2
Copy the example code
Use the copy button above to copy the entire code snippet.
Screenshot Placeholder - 3
Paste the code and update the endpoint
Replace the form API endpoint with the one you got in step 1.
Screenshot Placeholder - 4
Collect submissions
View and manage all form submissions in your parrotForms dashboard.
Screenshot Placeholder
Need more advanced forms?
Create a free parrotForms account to access more templates, save your forms, and collect submissions.
Create a Free Account