Skip to content

Contact form that copes with long labels

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
Open in a new tab

Description

French copy is longer on average than its English counterpart, and forms designed around one- or two-word labels break as soon as you write in full “Adresse électronique à laquelle recevoir le devis” or “Envoyer ma demande de devis gratuit”. This form, a joiner’s, is built for such copy: a single column that never grows wider than the screen, labels and messages that wrap (overflow-wrap, text-wrap: pretty), a submit button on two balanced lines at 320 px then full width on mobile, a dropdown whose long options do not push the layout, and an “(optional)” mention never split from its label. French typography is kept even in the messages written by the script: no-break space before colons, narrow no-break space inside guillemets, and “8 h”, “40 km” and “devis gratuit” never broken apart. On submission, an error summary appears at the top and receives focus; each of its links puts the cursor in the relevant field, and it updates as fields are corrected. Each message starts with “Erreur :” so it does not rely on colour alone, and the faulty field gets aria-invalid. Empty fields are flagged on submission, filled ones when leaving the field, and the error goes away as soon as it is fixed. The project description has a character counter and a 20-character minimum that tells how many are missing. To send it, listen to the contact-libelles:envoi event, which carries the form data, and post it to your service (Formspree, your own API…); without JavaScript, the fields remain real named fields. Accessibility: labels tied with for, hints, errors and counter tied with aria-describedby, required attribute, focus on the summary then on the confirmation, AA contrast in light and dark mode, 44 px targets, forced-colours fallback (double borders on faulty fields, system borders on buttons), transitions turned off with prefers-reduced-motion. Colours and radii are edited in the --fcl-* variables. No dependencies.

Code

Loading the code…

The code of this component in

Archive contents

formulaire-contact-textes-longs-francais-html-tailwind.zip3 files · 9 Ko

  • index.html20 Ko
  • README.md6 Ko
  • LICENSE.md1 Ko

Tags

Updated on December 2, 2026.

Reviews

No reviews yet.

In the same spirit

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

    • 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