Skip to content

SIRET field with validation

A SIRET or SIREN field that checks the Luhn key as you type, handles the La Poste exception, formats the number and links to the official business directory.

  • Tailwind
  • React
  • CSS
  • WordPress
Open in a new tab

Description

A wrong SIRET blocks an invoice or a business sign-up. This field checks the French company number as you type, with no network call: it counts the digits, recognises a SIREN (9 digits) or a SIRET (14 digits), checks the Luhn key of the SIREN then of the SIRET, and applies the exception for La Poste branches (SIREN 356 000 000, digit sum divisible by 5). The message tells a typo in the SIREN apart from a wrong establishment number. Spaces are accepted, the number is grouped (732 829 320 00074) when leaving the field, and a link to the official business directory (data.gouv.fr) appears once the number is valid, to check the company name. The state is announced in an aria-live region linked to the field with aria-describedby, aria-invalid flags the error and focus returns to the field on submit. Colour backed by text and a filled or empty dot, AA contrast in light and dark mode, no horizontal scrolling from 360 px. Example: a craftsman signing up on a quote platform.

Code

Loading the code…

The code of this component in

Archive contents

champ-siret-verification-html-tailwind.zip3 files · 6 Ko

  • index.html8 Ko
  • README.md4 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
  • 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