Skip to content

Association membership form with fee options in HTML and CSS

An online membership form: choice of fee (including a reduced rate and a free amount), optional donation and a live total summary.

Here is an excerpt of this component's code in HTML and CSS. The full code is free for members, ready to copy into your project.

This component also comes in

Open in a new tab

The code in HTML and CSS

index.html
<!doctype html>
<html lang="fr">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <title>Adhésion à une association avec choix de cotisation</title>
    <link rel="stylesheet" href="style.css" />
  </head>
  <body>
    <main class="demo">
      <form class="gaa" data-gaa novalidate aria-labelledby="gaa-titre">
        <p class="gaa-eyebrow">Saison 2026-2027 · de septembre à août</p>
script.js
document.querySelectorAll("[data-gaa]").forEach((root) => {
  const on = (el, type, fn) => el.addEventListener(type, fn);
  const plans = [...root.querySelectorAll('[name="formule"]')];
  const payments = [...root.querySelectorAll('[name="reglement"]')];
  const free = root.querySelector('[name="montant_libre"]');
  const gift = root.querySelector('[name="don"]');
  const name = root.querySelector('[name="nom"]');
  const email = root.querySelector('[name="email"]');
  const status = root.querySelector("[data-gaa-status]");
  const $ = (selector) => root.querySelector(selector);
  const plan = () => plans.find((radio) => radio.checked);
  const isFree = () => plan().value === "bienfaitrice";
style.css
:root {
  --gaa-card: #ffffff;
  --gaa-text: #26201a;
  --gaa-muted: #5c5146;
  --gaa-accent: #9a3412;
  --gaa-line: #d6ccc0;
  --gaa-soft: #fbf3ea;
  --gaa-error: #b91c1c;
  --demo-bg: #f1ebe3;
  --demo-text: #26201a;
}

Free component: copy it freely, including for commercial projects.

Forms and inputs components in HTML and CSS
  • A quote request form for tradespeople: the customer describes the work, picks a start date range and attaches up to six site photos, each with a preview, its size and a button to remove it.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • A quote request form whose labels, hints and error messages are full French sentences, still readable at 320 px: nothing overflows, nothing is cut off, and each error is tied to its field.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • Visitors pick a package and tick options: the pre-tax total, VAT and total including tax update live, and the summary is sent with the contact form.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • A short NPS survey: a 0 to 10 score as radio buttons, then a follow-up question adapted to whether the customer is a detractor, passive or promoter.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • An honest unsubscribe page: address prefilled from the link, choice between stopping everything or receiving less, optional reason and an undo.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • A callback request form: French phone number checked and formatted, topic, working day and time slot, with explicit consent to the call.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component