Event registration with remaining seats in WordPress
A registration form that shows the remaining seats per session, blocks full sessions and caps the number of seats requested.
Here is an excerpt of this component's code in WordPress. The full code is free for members, ready to copy into your project.
This component also comes in
The code in WordPress
<?php
/**
* Plugin Name: Forge, Inscription à un événement avec places restantes
* Description: Un formulaire d’inscription qui affiche les places restantes par séance, bloque les séances complètes et limite le nombre de places demandées. Ajoute la composition « Inscription à un événement avec places restantes » à l'éditeur de blocs.
* Version: 1.0.0
* Requires at least: 6.6
* Requires PHP: 8.1
* Author: Forge
* License: GPL-2.0-or-later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: forge-formulaire-inscription-evenement
*<!-- wp:html -->
<form class="gie" data-gie novalidate aria-labelledby="gie-titre">
<p class="gie-eyebrow">Maison de quartier des Batignolles · gratuit</p>
<h2 class="gie-title" id="gie-titre">Atelier compost et lombricompost</h2>
<p class="gie-intro">Deux heures pour apprendre à composter en appartement, avec un lombricomposteur offert par foyer. 12 places par séance.</p>
<fieldset class="gie-fs" aria-describedby="gie-err-seance">
<legend class="gie-legend">Séance</legend>
<label class="gie-option">
<input class="gie-radio" type="radio" name="seance" value="s1" data-gie-left="7">
<span class="gie-opt-text">
<span class="gie-opt-name">Samedi 14 novembre, 10 h – 12 h</span>
<span class="gie-opt-left" data-gie-left-for="s1">7 places restantes</span>(() => {
if (!document.querySelector(".gie")) return;
document.querySelectorAll("[data-gie]").forEach((root) => {
const on = (el, type, fn) => el.addEventListener(type, fn);
const MAX = 4;
const radios = [...root.querySelectorAll('[name="seance"]')];
const name = root.querySelector('[name="nom"]');
const email = root.querySelector('[name="email"]');
const seats = root.querySelector('[name="places"]');
const maxHelp = root.querySelector("[data-gie-max-help]");
const status = root.querySelector("[data-gie-status]");
const leftLabel = (n) => (n === 0 ? "Complet" : n === 1 ? "1 place restante" : `${n} places restantes`);:root {
--gie-card: #ffffff;
--gie-text: #14261c;
--gie-muted: #4a5d52;
--gie-accent: #166534;
--gie-line: #c3d0c8;
--gie-soft: #eef6f0;
--gie-error: #b91c1c;
--demo-formulaire-inscription-evenement-bg: #e9efe9;
--demo-formulaire-inscription-evenement-text: #14261c;
}
Free component: copy it freely, including for commercial projects.
Other forms and inputs components in WordPress
Forms and inputs components in WordPress
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

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

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

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

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

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