[Fix #3692] Add HTML5 validation to ensure SIRET length is 14

This commit is contained in:
Mathieu Magnin 2019-03-27 18:56:18 +01:00
parent bd265c6f32
commit 7ed1e5ac82

View file

@ -2,7 +2,9 @@
placeholder: champ.libelle,
class: 'small-margin',
data: { remote: true, debounce: true, url: champs_siret_path(form.index), params: { champ_id: champ&.id }.to_query, spinner: true },
required: champ.mandatory?
required: champ.mandatory?,
pattern: "[0-9]{14}",
title: "Le numéro de SIRET doit comporter exactement 14 chiffres"
.spinner.right-spinner.hidden
%div{ class: "siret-info-#{form.index}" }
- if champ.etablissement.present?