diff options
author | tristantheb <tristantheb@users.noreply.github.com> | 2021-06-06 11:44:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-06 11:44:55 +0200 |
commit | 6f85683973762f84f6d99211b3b6158059e16f5a (patch) | |
tree | 19dbf2006709d2841b8535fd3c0d6390edc2643b /files/fr/web/html/attributes/minlength | |
parent | 6781d84b8a98f4c28efebaf7ed15d0666083ef11 (diff) | |
download | translated-content-6f85683973762f84f6d99211b3b6158059e16f5a.tar.gz translated-content-6f85683973762f84f6d99211b3b6158059e16f5a.tar.bz2 translated-content-6f85683973762f84f6d99211b3b6158059e16f5a.zip |
UPDATE: Update translation of the HTML attributes (#706)
* UPDATE: Refresh of the index page and remove KS
* L10N: Translation of the accept attributes
* UPDATE: Refresh of the autocomplete attribute
* L10N: Translation of the capture attribute
* Revert accept with BCD (but table not exist)
* UPDATE: Refresh the crossorigin attribute
* L10N: Translation of the disabled attribute
* L10N: Translation of the elementtiming attribute
* L10N: Translation of the for attribute
* L10N: Translation of the max attribute
* L10N: Translation of the maxlength attribute
* L10N: Translation of the min attribute
* FIX: Add missing summary
* L10N: Translation of the minlength attribute
* L10N: Translation of the multiple attribute
* UPDATE: Refresh the pattern attribute
* L10N: Translation of the readonly attribute
* L10N: Translation of the rel attribute
* L10N: Translation of the required attribute
* L10N: Translation of the size attribute
* L10N: Translation of the step attribute
* Review - attr accept
* Typo live sample
* Review - capture
* Review - autocomplete
* Review - crossorigin
* Review disabled
* Review elementtiming
* Review - for
* Review max
* Review - maxlength
* Review min
* Review minlength
* Review multiple
* Review pattern
* Review readonly
* Review rel
* Review required
* Review size
* Review step
* Review attributes index
Co-authored-by: julieng <julien.gattelier@gmail.com>
Diffstat (limited to 'files/fr/web/html/attributes/minlength')
-rw-r--r-- | files/fr/web/html/attributes/minlength/index.html | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/files/fr/web/html/attributes/minlength/index.html b/files/fr/web/html/attributes/minlength/index.html new file mode 100644 index 0000000000..42bbc2ab19 --- /dev/null +++ b/files/fr/web/html/attributes/minlength/index.html @@ -0,0 +1,76 @@ +--- +title: 'Attribut HTML : minlength' +slug: Web/HTML/Attributes/minlength +tags: + - Attribute + - Attributes + - Constraint validation + - HTML + - Input + - Reference + - minlength + - textarea +translation_of: Web/HTML/Attributes/minlength +--- +<p>{{HTMLSidebar}}</p> + +<p class="summary">L'attribut <strong><code>minlength</code></strong> définit le nombre minimal de caractères (sous forme d'unités de code UTF-16) que l'utilisateur peut saisir dans un élément <a href="/fr/docs/Web/HTML/Element/Input"><code><input></code></a> ou <a href="/fr/docs/Web/HTML/Element/Textarea"><code><textarea></code></a>. Il doit s'agir d'une valeur entière égale ou supérieure à 0. Si aucune longueur minimale n'est spécifiée, ou si une valeur invalide est spécifiée, l'entrée n'a pas de longueur minimale. Cette valeur doit être inférieure ou égale à la valeur de <a href="/fr/docs/Web/HTML/Attributes/maxlength"><code>maxlength</code></a>, sinon la valeur ne sera jamais valide, car il est impossible de satisfaire aux deux critères.</p> + +<p>L'entrée échouera à la validation des contraintes si la longueur de la valeur textuelle du champ est inférieure à <code>minlength</code> unités de code UTF-16, avec <a href="/fr/docs/Web/API/validityState/tooShort"><code>validityState.tooShort</code></a> retournant <code>true</code>. La validation des contraintes n'est appliquée que lorsque la valeur est modifiée par l'utilisateur. En cas d'échec de la soumission, certains navigateurs affichent un message d'erreur indiquant la longueur minimale requise et la longueur actuelle.</p> + +<h2 id="examples">Exemples</h2> + +<p>En ajoutant <code>minlength="5"</code>, la valeur doit soit être vide, soit comporter cinq caractères ou plus pour être valide.</p> + +<pre class="brush: html"><label for="fruit">Entrez un nom de fruit d'au moins 5 lettres.</label> +<input type="text" minlength="5" id="fruit"></pre> + +<p>Nous pouvons utiliser des pseudo-classes pour donner un style à l'élément en fonction de la validité de la valeur. La valeur sera valide tant qu'elle sera soit nulle (vide), soit longue de cinq caractères ou plus. <em>Vert</em> est invalide, <em>Citron</em> est valide.</p> + +<pre class="brush: css">input { + border: 2px solid currentcolor; +} +input:invalid { + border: 2px dashed red; +} +input:invalid:focus { + background-image: linear-gradient(pink, lightgreen); +}</pre> + +<div>{{EmbedLiveSample('examples', '', 40)}}</div> + +<h2 id="specifications">Spécifications</h2> + +<table class="standard-table"> + <thead> + <tr> + <th scope="col">Spécification</th> + <th scope="col">Statut</th> + </tr> + </thead> + <tbody> + <tr> + <td>{{SpecName('HTML WHATWG', 'input.html#attr-input-minlength', 'l\'attribut minlength')}}</td> + <td>{{Spec2('HTML WHATWG')}}</td> + </tr> + <tr> + <td>{{SpecName('HTML5.1', 'input.html#attr-minlength-accept', 'l\'attribut minlength')}}</td> + <td>{{Spec2('HTML5.1')}}</td> + </tr> + </tbody> +</table> + +<h2 id="browser_compatibility">Compatibilité des navigateurs</h2> + +<p>{{Compat("html.elements.attribute.minlength")}}</p> + +<h2 id="see_also">Voir aussi</h2> + +<ul> + <li>L'attribut <a href="/fr/docs/Web/HTML/Attributes/maxlength"><code>maxlength</code></a></li> + <li>L'attribut <a href="/fr/docs/Web/HTML/Attributes/size"><code>size</code></a></li> + <li>L'attribut <a href="/fr/docs/Web/HTML/Attributes/pattern"><code>pattern</code></a></li> + <li><a href="/fr/docs/Web/Guide/HTML/HTML5/Constraint_validation">Validation des contraintes</a></li> + <li>L'API <a href="/fr/docs/Web/API/Constraint_validation">Constraint validation</a></li> + <li>L'élément <a href="/fr/docs/Web/HTML/Element/Input"><code><input></code></a></li> +</ul> |