Filtrage champ de saisie clé
This commit is contained in:
parent
3af3dcd681
commit
e0fb90d207
@ -13,3 +13,21 @@
|
||||
*/
|
||||
|
||||
|
||||
$(document).ready(function () {
|
||||
$('#userAuthKey').on('input', function () {
|
||||
// Récupère la valeur du champ
|
||||
let input = $(this).val();
|
||||
|
||||
// Supprime tous les caractères non numériques
|
||||
input = input.replace(/\D/g, '');
|
||||
|
||||
// Limite à 6 caractères maximum
|
||||
if (input.length > 6) {
|
||||
input = input.substring(0, 6);
|
||||
}
|
||||
|
||||
// Met à jour la valeur du champ
|
||||
$(this).val(input);
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -13,10 +13,10 @@
|
||||
'value' => template::ico('left')
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col2 offset8" id="loginContainer">
|
||||
<div class="col3 offset7" id="loginContainer">
|
||||
<?php echo template::submit('userLoginSubmit', [
|
||||
'value' => template::ico('check'),
|
||||
'ico' => '',
|
||||
'value' => 'Connexion',
|
||||
'ico' => ''
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user