Projet

Général

Profil

Development #45152

Attribut inputmode sur les champs

Ajouté par Frédéric Péters il y a presque 4 ans. Mis à jour il y a presque 4 ans.

Statut:
Fermé
Priorité:
Normal
Assigné à:
-
Version cible:
-
Début:
15 juillet 2020
Echéance:
% réalisé:

0%

Temps estimé:
Patch proposed:
Oui
Planning:
Non

Description

Dans #38980,

code postal/SIREN/SIRET = <input type="number" />...

mais ça n'est pas approprié,

The type=number state is not appropriate for input that happens to only consist of numbers but isn't strictly speaking a number. For example, it would be inappropriate for credit card numbers or US postal codes. A simple way of determining whether to use type=number is to consider whether it would make sense for the input control to have a spinbox interface (e.g. with "up" and "down" arrows). Getting a credit card number wrong by 1 in the last digit isn't a minor mistake, it's as wrong as getting every digit incorrect. So it would not make sense for the user to select a credit card number using "up" and "down" buttons. When a spinbox interface is not appropriate, type=text is probably the right choice (possibly with an inputmode or pattern attribute).
https://html.spec.whatwg.org/multipage/input.html#when-number-is-not-appropriate (via https://css-tricks.com/finger-friendly-numerical-inputs-with-inputmode/

Et donc suivre la suggestion, inputmode.


Fichiers

Révisions associées

Révision f8be9e5c (diff)
Ajouté par Frédéric Péters il y a presque 4 ans

misc: add inputmode=number attribute on zipcode/etc. widgets (#45152)

Historique

#1

Mis à jour par Frédéric Péters il y a presque 4 ans

#2

Mis à jour par Thomas Noël il y a presque 4 ans

Il faut laisser libre la saisie pour IBAN (y'a des lettres dedans, FR...) et le numéro de sécu (parce que départements 2A et 2B pour les Corses).

#3

Mis à jour par Frédéric Péters il y a presque 4 ans

Pour avoir du chercher, si les gens disent "numéro de sécu", peut-être que ça devrait se trouver dans le libellé, plutôt que "NIR (France)".

(branche à jour)

#4

Mis à jour par Thomas Noël il y a presque 4 ans

  • Statut changé de Solution proposée à Solution validée
#5

Mis à jour par Frédéric Péters il y a presque 4 ans

  • Statut changé de Solution validée à Résolu (à déployer)

(je l'ai aussi ajouté à la validation "nombre", que j'avais zappée).

commit f8be9e5c56ced4f805af1e6768f27a0695c92c0e
Author: Frédéric Péters <fpeters@entrouvert.com>
Date:   Wed Jul 15 19:10:48 2020 +0200

    misc: add inputmode=number attribute on zipcode/etc. widgets (#45152)
#6

Mis à jour par Frédéric Péters il y a presque 4 ans

  • Statut changé de Résolu (à déployer) à Solution déployée

Formats disponibles : Atom PDF