Filtrage champ de saisie clé

This commit is contained in:
Fred Tempez 2024-12-23 15:33:09 +01:00
parent b85a0bfa78
commit 58b4ca15c6
3 changed files with 38 additions and 7 deletions

View File

@ -12,8 +12,6 @@
* @link http://zwiicms.fr/
*/
/** @import url("site/data/admin.css"); */
/** NE PAS EFFACER
* admin.css
*/

View File

@ -0,0 +1,33 @@
/**
* This file is part of Zwii.
*
* For full copyright and license information, please see the LICENSE
* file that was distributed with this source code.
*
* @author Rémi Jean <remi.jean@outlook.com>
* @copyright Copyright (C) 2008-2018, Rémi Jean
* @author Frédéric Tempez <frederic.tempez@outlook.com>
* @copyright Copyright (C) 2018-2025, Frédéric Tempez
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
* @link http://zwiicms.fr/
*/
$(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);
});
});

View File

@ -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>