Snippets Contact form

Bootstrap 5 Contact Form with Contact Info Panel

A split contact form with a brand panel listing email, phone and address, floating-label fields, a message counter and validation.

Bootstrap 5 No jQuery Jun 2019 6.1K views

<section class="wdw-stage">
  <div class="container" style="max-width:1000px">
    <div class="wdw-card overflow-hidden">
      <div class="row g-0">
        <aside class="col-lg-5 wdw-aurora p-4 p-md-5 d-flex flex-column justify-content-between gap-5">
          <div>
            <span class="wdw-eyebrow text-white opacity-75 mb-2">Contact</span>
            <h2 class="fw-bold display-6 mb-3" style="letter-spacing:-.02em">We would love to hear from you</h2>
            <p class="opacity-75 mb-0">Questions, ideas or a project in mind? Send a note and we will reply within one business day.</p>
          </div>
          <ul class="list-unstyled d-grid gap-3 mb-0">
            <li class="d-flex align-items-center gap-3"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="3" y="5" width="18" height="14" rx="2"/><path d="m3 7 9 6 9-6"/></svg>[email protected]</li>
            <li class="d-flex align-items-center gap-3"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 4h4l2 5-2.5 1.5a11 11 0 0 0 5 5L15 13l5 2v4a2 2 0 0 1-2 2A16 16 0 0 1 3 6a2 2 0 0 1 2-2z"/></svg>+1 (555) 013-2468</li>
            <li class="d-flex align-items-center gap-3"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 21s7-6.2 7-11a7 7 0 1 0-14 0c0 4.8 7 11 7 11z"/><circle cx="12" cy="10" r="2.5"/></svg>221 Market Street, San Francisco</li>
          </ul>
        </aside>
        <div class="col-lg-7">
          <form class="p-4 p-md-5" id="ct-form" novalidate>
            <div class="row g-3">
              <div class="col-sm-6"><div class="form-floating"><input class="form-control" id="ct-fn" placeholder="First name" autocomplete="given-name" required><label for="ct-fn">First name</label></div></div>
              <div class="col-sm-6"><div class="form-floating"><input class="form-control" id="ct-ln" placeholder="Last name" autocomplete="family-name" required><label for="ct-ln">Last name</label></div></div>
              <div class="col-12"><div class="form-floating"><input type="email" class="form-control" id="ct-em" placeholder="Email" autocomplete="email" required><label for="ct-em">Email</label><div class="invalid-feedback">Enter a valid email address.</div></div></div>
              <div class="col-12"><div class="form-floating"><textarea class="form-control ct-area" id="ct-msg" placeholder="Message" maxlength="500" required></textarea><label for="ct-msg">How can we help?</label></div><div class="small wdw-muted text-end mt-1"><span id="ct-count">0</span>/500</div></div>
              <div class="col-12 d-flex flex-wrap align-items-center gap-3">
                <button type="submit" class="btn btn-primary rounded-pill px-4">Send message</button>
                <span class="small wdw-muted">We never share your details.</span>
              </div>
              <div class="col-12"><div class="alert alert-success d-none mb-0 py-2" id="ct-ok" role="status">Thanks, your message is on its way.</div></div>
            </div>
          </form>
        </div>
      </div>
    </div>
  </div>
</section>

Built on Bootstrap 5.3.8 with plain JavaScript — no jQuery. Supports light and dark mode via data-bs-theme.

Free to use in personal and commercial projects under the MIT license.