Skip to content

Unsolicited job application form in WordPress

A recruitment form for small businesses: target position, introduction, CV checked in the browser and GDPR consent, with inline errors.

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

Open in a new tab

The code in WordPress

formulaire-candidature-spontanee.php
<?php
/**
 * Plugin Name: Forge, Formulaire de candidature spontanée
 * Description: Un formulaire de recrutement pour TPE : poste visé, présentation, CV contrôlé dans le navigateur et consentement RGPD, avec des erreurs affichées en ligne. Ajoute la composition « Formulaire de candidature spontanée » à 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-candidature-spontanee
 *
pattern.html
<!-- wp:html -->
<form class="fcs" data-fcs data-fcs-endpoint="" method="post" enctype="multipart/form-data" aria-labelledby="fcs-titre">
        <div class="fcs-head">
          <p class="fcs-eyebrow">Menuiserie Vasseur · Angers</p>
          <h2 class="fcs-title" id="fcs-titre">Envie de rejoindre l’atelier ?</h2>
          <p class="fcs-lead">Aucune offre en ligne ne vous correspond ? Présentez-vous : nous répondons à chaque candidature sous 15 jours.</p>
          <p class="fcs-hint">Tous les champs sont obligatoires, sauf mention contraire.</p>
        </div>
        <div class="fcs-field">
          <label class="fcs-label" for="fcs-poste">Poste visé</label>
          <select class="fcs-input fcs-select" id="fcs-poste" name="poste" required aria-describedby="fcs-err-poste">
            <option value="">Choisissez un poste</option>
script.js
(() => {
  if (!document.querySelector(".fcs")) return;
  document.querySelectorAll("[data-fcs]").forEach((root) => {
    const on = (el, type, fn) => el.addEventListener(type, fn);
    const $ = (selector) => root.querySelector(selector);
    const form = root;
    const job = $('[name="poste"]');
    const fullName = $('[name="nom"]');
    const email = $('[name="email"]');
    const phone = $('[name="telephone"]');
    const pitch = $('[name="presentation"]');
    const cv = $('[name="cv"]');
style.css
:root {
  --fcs-scheme: light;
  --fcs-card: #ffffff;
  --fcs-text: #2a1d13;
  --fcs-muted: #5f5043;
  --fcs-accent: #8a4b12;
  --fcs-on-accent: #ffffff;
  --fcs-line: #8d7b6b;
  --fcs-soft: #f8efe6;
  --fcs-error: #b42318;
  --demo-formulaire-candidature-spontanee-bg: #efe7de;
  --demo-formulaire-candidature-spontanee-text: #2a1d13;

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

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
    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