Bootstrap 5 Multi-Step Request a Quote Form
A multi-step quote request form with a progress bar, selectable service cards, personal and company detail steps with validation, and a success screen. Built with Bootstrap 5 form components and a short vanilla script.
<section class="wdw-stage">
<div class="container" style="max-width:640px">
<form class="wdw-card p-4 p-md-5 q-wizard" novalidate aria-labelledby="q-title">
<h1 id="q-title" class="wdw-heading h3 mb-1">Request a quote</h1>
<p class="wdw-muted mb-4">Fill out the form or call <a href="tel:+11234567891" class="fw-semibold link-primary link-underline-opacity-0">123 456 7891</a> to start protecting your business today.</p>
<div class="d-flex align-items-center gap-3 mb-4">
<div class="progress flex-grow-1" role="progressbar" aria-label="Quote progress" aria-valuemin="0" aria-valuemax="100" aria-valuenow="25" style="height:.5rem">
<div class="progress-bar rounded-pill" id="q-bar" style="width:25%"></div>
</div>
<span class="small fw-semibold wdw-muted text-nowrap" id="q-count">Step 1 of 3</span>
</div>
<div class="q-panel" data-panel="0">
<h2 class="h6 fw-bold mb-3">Select service(s)</h2>
<div class="row g-3">
<div class="col-6">
<input type="checkbox" class="btn-check" id="svc-paper" name="service" value="paper" autocomplete="off">
<label class="svc-card" for="svc-paper">
<span class="wdw-icon mb-2"><svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.85" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8Z"/><path d="M14 3v5h5M9 13h6M9 17h6"/></svg></span>
<span class="fw-semibold">One-time paper cleanout</span>
<span class="small wdw-muted">Clear out stored records</span>
</label>
</div>
<div class="col-6">
<input type="checkbox" class="btn-check" id="svc-regular" name="service" value="regular" autocomplete="off">
<label class="svc-card" for="svc-regular">
<span class="wdw-icon mb-2"><svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.85" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="3" y="4" width="18" height="17" rx="2"/><path d="M16 2v4M8 2v4M3 10h18"/></svg></span>
<span class="fw-semibold">Scheduled shredding</span>
<span class="small wdw-muted">Recurring pickups</span>
</label>
</div>
<div class="col-6">
<input type="checkbox" class="btn-check" id="svc-drive" name="service" value="drive" autocomplete="off">
<label class="svc-card" for="svc-drive">
<span class="wdw-icon mb-2"><svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.85" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><ellipse cx="12" cy="5" rx="8" ry="3"/><path d="M4 5v6c0 1.7 3.6 3 8 3s8-1.3 8-3V5M4 11v6c0 1.7 3.6 3 8 3s8-1.3 8-3v-6"/></svg></span>
<span class="fw-semibold">Hard drive destruction</span>
<span class="small wdw-muted">Certified media destruction</span>
</label>
</div>
<div class="col-6">
<input type="checkbox" class="btn-check" id="svc-other" name="service" value="other" autocomplete="off">
<label class="svc-card" for="svc-other">
<span class="wdw-icon mb-2"><svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.85" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M21 8 12 3 3 8v8l9 5 9-5Z"/><path d="m3 8 9 5 9-5M12 13v8"/></svg></span>
<span class="fw-semibold">Other materials</span>
<span class="small wdw-muted">Uniforms, products, more</span>
</label>
</div>
</div>
<div class="text-danger small mt-2 d-none" data-err="service">Choose at least one service.</div>
</div>
<div class="q-panel d-none" data-panel="1">
<h2 class="h6 fw-bold mb-3">Personal details</h2>
<div class="row g-3">
<div class="col-sm-6"><div class="form-floating"><input class="form-control" id="q-first" placeholder="First name" autocomplete="given-name" required><label for="q-first">First name</label><div class="invalid-feedback">Required.</div></div></div>
<div class="col-sm-6"><div class="form-floating"><input class="form-control" id="q-last" placeholder="Last name" autocomplete="family-name" required><label for="q-last">Last name</label><div class="invalid-feedback">Required.</div></div></div>
<div class="col-12"><div class="form-floating"><input type="email" class="form-control" id="q-email" placeholder="Email" autocomplete="email" required><label for="q-email">Email</label><div class="invalid-feedback">Enter a valid email.</div></div></div>
<div class="col-12"><div class="form-floating"><input type="tel" class="form-control" id="q-phone" placeholder="Phone" autocomplete="tel" required><label for="q-phone">Contact number</label><div class="invalid-feedback">Required.</div></div></div>
</div>
</div>
<div class="q-panel d-none" data-panel="2">
<h2 class="h6 fw-bold mb-3">Company details</h2>
<div class="row g-3">
<div class="col-12"><div class="form-floating"><input class="form-control" id="q-company" placeholder="Company" autocomplete="organization" required><label for="q-company">Company name</label><div class="invalid-feedback">Required.</div></div></div>
<div class="col-sm-4"><div class="form-floating"><input class="form-control" id="q-zip" placeholder="Zip" autocomplete="postal-code" required><label for="q-zip">Zip code</label><div class="invalid-feedback">Required.</div></div></div>
<div class="col-sm-4"><div class="form-floating"><input class="form-control" id="q-state" placeholder="State" required><label for="q-state">State</label><div class="invalid-feedback">Required.</div></div></div>
<div class="col-sm-4"><div class="form-floating"><input class="form-control" id="q-city" placeholder="City" autocomplete="address-level2" required><label for="q-city">City</label><div class="invalid-feedback">Required.</div></div></div>
<div class="col-12"><div class="form-floating"><select class="form-select" id="q-size" required><option value="" selected disabled>Choose…</option><option>1-20 boxes</option><option>20-50 boxes</option><option>50-100 boxes</option><option>100+ boxes</option></select><label for="q-size">Shredding job size</label><div class="invalid-feedback">Choose a size.</div></div></div>
</div>
</div>
<div class="q-panel d-none text-center py-4" data-panel="3" tabindex="-1">
<span class="q-check mb-3" aria-hidden="true"><svg width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.25" stroke-linecap="round" stroke-linejoin="round"><path d="M20 6 9 17l-5-5"/></svg></span>
<h2 class="h4 fw-bold">Success!</h2>
<p class="wdw-muted mb-0">Thank you for choosing us. A specialist will send your quote within one business day.</p>
</div>
<div class="d-flex justify-content-between gap-2 mt-4" id="q-actions">
<button type="button" class="btn btn-outline-primary rounded-pill px-4 invisible" data-prev>Back</button>
<button type="button" class="btn btn-primary rounded-pill px-4" data-next>Continue</button>
</div>
</form>
</div>
</section>
/* Web Designer Wall library style — shared base for every Bootstrap 5 snippet.
Indigo accent, Plus Jakarta Sans, soft cards, pill buttons. Works in light and dark. */
@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap");
:root,
[data-bs-theme="light"] {
--wdw-font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
--bs-body-font-family: var(--wdw-font);
--bs-primary: #4f46e5;
--bs-primary-rgb: 79, 70, 229;
--bs-primary-text-emphasis: #3730a3;
--bs-primary-bg-subtle: #eef2ff;
--bs-primary-border-subtle: #c7d2fe;
--bs-link-color: #4f46e5;
--bs-link-color-rgb: 79, 70, 229;
--bs-link-hover-color: #4338ca;
--bs-link-hover-color-rgb: 67, 56, 202;
--bs-focus-ring-color: rgba(79, 70, 229, 0.25);
--bs-border-radius: 0.75rem;
--bs-border-radius-lg: 1rem;
--bs-border-radius-xl: 1.25rem;
--wdw-radius-card: 1.25rem;
--wdw-shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 16px 40px -16px rgba(16, 24, 40, 0.22);
--wdw-shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06), 0 4px 12px -4px rgba(16, 24, 40, 0.12);
--wdw-stage: #f5f6fb;
}
[data-bs-theme="dark"] {
--bs-primary: #818cf8;
--bs-primary-rgb: 129, 140, 248;
--bs-primary-text-emphasis: #c7d2fe;
--bs-primary-bg-subtle: rgba(129, 140, 248, 0.14);
--bs-primary-border-subtle: rgba(129, 140, 248, 0.35);
--bs-link-color: #a5b4fc;
--bs-link-color-rgb: 165, 180, 252;
--bs-link-hover-color: #c7d2fe;
--bs-link-hover-color-rgb: 199, 210, 254;
--bs-focus-ring-color: rgba(129, 140, 248, 0.35);
--wdw-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 16px 40px -16px rgba(0, 0, 0, 0.7);
--wdw-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 12px -4px rgba(0, 0, 0, 0.5);
--wdw-stage: #0f1117;
}
body { font-family: var(--wdw-font); -webkit-font-smoothing: antialiased; }
/* Bootstrap compiles its blue into these components; point them at the accent. */
.btn-primary {
--bs-btn-bg: var(--bs-primary); --bs-btn-border-color: var(--bs-primary);
--bs-btn-hover-bg: #4338ca; --bs-btn-hover-border-color: #4338ca;
--bs-btn-active-bg: #3730a3; --bs-btn-active-border-color: #3730a3;
--bs-btn-disabled-bg: var(--bs-primary); --bs-btn-disabled-border-color: var(--bs-primary);
--bs-btn-focus-shadow-rgb: var(--bs-primary-rgb);
}
[data-bs-theme="dark"] .btn-primary { --bs-btn-color: #0f1117; --bs-btn-hover-bg: #a5b4fc; --bs-btn-hover-border-color: #a5b4fc; --bs-btn-hover-color: #0f1117; --bs-btn-active-color: #0f1117; }
.btn-outline-primary {
--bs-btn-color: var(--bs-primary); --bs-btn-border-color: var(--bs-primary);
--bs-btn-hover-bg: var(--bs-primary); --bs-btn-hover-border-color: var(--bs-primary);
--bs-btn-active-bg: var(--bs-primary); --bs-btn-active-border-color: var(--bs-primary);
--bs-btn-focus-shadow-rgb: var(--bs-primary-rgb);
}
.btn { --bs-btn-font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; }
.btn-sm { min-height: 36px; }
.form-control, .form-select { min-height: 44px; border-radius: .75rem; }
.form-control:focus, .form-select:focus, .form-check-input:focus { border-color: rgba(var(--bs-primary-rgb), .6); box-shadow: 0 0 0 .25rem var(--bs-focus-ring-color); }
.form-check-input:checked { background-color: var(--bs-primary); border-color: var(--bs-primary); }
.nav-pills { --bs-nav-pills-link-active-bg: var(--bs-primary); }
.nav { --bs-nav-link-color: var(--bs-secondary-color); --bs-nav-link-hover-color: var(--bs-emphasis-color); }
.pagination { --bs-pagination-active-bg: var(--bs-primary); --bs-pagination-active-border-color: var(--bs-primary); --bs-pagination-color: var(--bs-body-color); --bs-pagination-focus-box-shadow: 0 0 0 .25rem var(--bs-focus-ring-color); }
.progress, .progress-stacked { --bs-progress-bar-bg: var(--bs-primary); }
.list-group { --bs-list-group-active-bg: var(--bs-primary); --bs-list-group-active-border-color: var(--bs-primary); }
.dropdown-menu { --bs-dropdown-link-active-bg: var(--bs-primary); border-radius: .875rem; box-shadow: var(--wdw-shadow-sm); }
.accordion { --bs-accordion-active-bg: var(--bs-primary-bg-subtle); --bs-accordion-active-color: var(--bs-primary-text-emphasis); --bs-accordion-btn-focus-box-shadow: 0 0 0 .25rem var(--bs-focus-ring-color); }
.badge { font-weight: 600; }
/* Library building blocks — use these instead of re-inventing them per snippet. */
.wdw-stage { min-height: 100vh; display: flex; align-items: center; background: var(--wdw-stage); padding-block: 3rem; }
.wdw-card { background: var(--bs-body-bg); border: 1px solid var(--bs-border-color-translucent); border-radius: var(--wdw-radius-card); box-shadow: var(--wdw-shadow); }
.wdw-card-sm { background: var(--bs-body-bg); border: 1px solid var(--bs-border-color-translucent); border-radius: 1rem; box-shadow: var(--wdw-shadow-sm); }
.wdw-aurora { position: relative; color: #fff; background: radial-gradient(60% 55% at 100% 0, #818cf8 0, transparent 70%), radial-gradient(65% 60% at 0 100%, #ec4899 0, transparent 65%), #1e1b4b; }
.wdw-eyebrow { display: inline-block; font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--bs-primary); }
.wdw-heading { font-weight: 800; letter-spacing: -.02em; color: var(--bs-emphasis-color); }
.wdw-muted { color: var(--bs-secondary-color); }
.wdw-icon { width: 2.75rem; height: 2.75rem; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: .875rem; background: var(--bs-primary-bg-subtle); color: var(--bs-primary); }
/* Component */
.svc-card { display: flex; flex-direction: column; height: 100%; padding: 1rem; border: 1.5px solid var(--bs-border-color); border-radius: 1rem; cursor: pointer; background: var(--bs-body-bg); transition: border-color .15s, background .15s, box-shadow .15s; }
.svc-card:hover { border-color: var(--bs-primary-border-subtle); background: var(--bs-tertiary-bg); }
.btn-check:checked + .svc-card { border-color: var(--bs-primary); background: var(--bs-primary-bg-subtle); box-shadow: 0 0 0 .2rem var(--bs-focus-ring-color); }
.btn-check:focus-visible + .svc-card { outline: 2px solid var(--bs-primary); outline-offset: 2px; }
.btn-check:checked + .svc-card .wdw-icon { background: var(--bs-primary); color: #fff; }
[data-bs-theme="dark"] .btn-check:checked + .svc-card .wdw-icon { color: #0f1117; }
.q-check { display: inline-grid; place-items: center; width: 3.5rem; height: 3.5rem; border-radius: 50%; background: var(--bs-success-bg-subtle); color: var(--bs-success-text-emphasis); }
.q-panel { animation: q-in .25s ease; }
@keyframes q-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .q-panel { animation: none; } }
@media (max-width: 400px) { .svc-card { padding: .75rem; } }
function initQuoteWizard() {
const form = document.querySelector('.q-wizard');
if (!form) return;
const panels = form.querySelectorAll('.q-panel');
const bar = form.querySelector('#q-bar');
const count = form.querySelector('#q-count');
const prev = form.querySelector('[data-prev]');
const next = form.querySelector('[data-next]');
const actions = form.querySelector('#q-actions');
const track = bar.parentElement;
const total = 3;
let current = 0;
const show = (i) => {
current = i;
panels.forEach((p, n) => p.classList.toggle('d-none', n !== i));
const pct = Math.min(100, Math.round(((i + 1) / (total + 1)) * 100));
bar.style.width = (i === total ? 100 : pct) + '%';
track.setAttribute('aria-valuenow', i === total ? 100 : pct);
count.textContent = i === total ? 'Complete' : 'Step ' + (i + 1) + ' of ' + total;
prev.classList.toggle('invisible', i === 0 || i === total);
actions.classList.toggle('d-none', i === total);
next.textContent = i === total - 1 ? 'Request quote' : 'Continue';
if (i === total) panels[i].focus({ preventScroll: true });
};
const validate = (i) => {
let ok = true;
if (i === 0) {
const any = form.querySelector('input[name="service"]:checked');
form.querySelector('[data-err="service"]').classList.toggle('d-none', !!any);
return !!any;
}
panels[i].querySelectorAll('input[required], select[required]').forEach((f) => {
const valid = f.checkValidity() && f.value.trim() !== '';
f.classList.toggle('is-invalid', !valid);
if (!valid) ok = false;
});
return ok;
};
next.addEventListener('click', () => { if (validate(current)) show(current + 1); });
prev.addEventListener('click', () => show(current - 1));
form.addEventListener('submit', (e) => e.preventDefault());
form.querySelectorAll('input[name="service"]').forEach((c) => c.addEventListener('change', () => form.querySelector('[data-err="service"]').classList.add('d-none')));
form.addEventListener('input', (e) => { if (e.target.classList.contains('is-invalid')) validate(current); });
show(0);
}
initQuoteWizard();
Built on Bootstrap 5.3.8 with plain JavaScript — no jQuery. Supports light and dark mode via data-bs-theme.