Merge branch 'main' of https://git.ebene.ovh/ebene/prestation
This commit is contained in:
commit
a225a5274e
|
|
@ -3,66 +3,26 @@
|
|||
?>
|
||||
|
||||
<form id="frmrechercheparcarte" name="frmrechercheparcarte" method="post" action="Rechercheparcarte/index/">
|
||||
<INPUT style='font-size:40pt;height: 50px;' class="form-control" TYPE="text" id="donneesCarte" name="donneesCarte" autofocus AUTOCOMPLETE="OFF" placeholder="<?= _("Veuillez scanner la carte NFC!")?>">
|
||||
<INPUT style='font-size:40pt; height: 50px; text-align: center;' class="form-control" TYPE="text" id="donneesCarte" name="donneesCarte" autofocus AUTOCOMPLETE="OFF" placeholder="<?= _("Veuillez scanner la carte NFC!")?>">
|
||||
<input id="lancerrechercheparcarte" name="lancerrechercheparcarte" class="sr-only" type="submit" value="<?= _("Rechercher") ?>" >
|
||||
</form>
|
||||
|
||||
<div id ="div_wait_nfc"> </div>
|
||||
|
||||
<?php if (isset($msgErreur) && $msgErreur>" "): ?>
|
||||
<div class="alert alert-danger" style="height:38px; padding:5px;" >
|
||||
<H4><?= $msgErreur ?></H4>
|
||||
</div>
|
||||
<div class="alert alert-danger" style="height:38px; padding:5px; text-align: center;">
|
||||
<H4><?= $msgErreur ?></H4>
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
/*
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
const input = document.getElementById('donneesCarte');
|
||||
const form = document.getElementById('frmrechercheparcarte');
|
||||
|
||||
let buffer = '';
|
||||
let timer = null;
|
||||
|
||||
// Capture globale (lecteur NFC = clavier)
|
||||
document.addEventListener('keydown', function (e) {
|
||||
|
||||
// ENTER → soumission immédiate
|
||||
if (e.key === 'Enter') {
|
||||
if (buffer.length > 0) {
|
||||
input.value = buffer;
|
||||
buffer = '';
|
||||
form.submit();
|
||||
}
|
||||
e.preventDefault();
|
||||
return;
|
||||
}
|
||||
|
||||
// Ignorer touches spéciales
|
||||
if (e.key.length > 1) return;
|
||||
|
||||
// Accumuler caractères scannés
|
||||
buffer += e.key;
|
||||
|
||||
// Reset après 300 ms d'inactivité (sécurité)
|
||||
clearTimeout(timer);
|
||||
timer = setTimeout(() => {
|
||||
if (buffer.length > 0) {
|
||||
input.value = buffer;
|
||||
buffer = '';
|
||||
form.submit();
|
||||
}
|
||||
}, 300);
|
||||
});
|
||||
});
|
||||
*/
|
||||
|
||||
<script>
|
||||
document.getElementById('donneesCarte').addEventListener('change', function () {
|
||||
if (this.value.length > 3) {
|
||||
alert("submit");
|
||||
this.form.submit();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
document.getElementById('donneesCarte').addEventListener('change', function () {
|
||||
if (this.value.length > 3) {
|
||||
var div_wait_nfc = $('#div_wait_nfc');
|
||||
div_wait_nfc.html('<div style="padding-top:80px; text-align:center; font-size:14px; color: #4caf50;"><span><i class="fa fa-spinner fa-spin fa-5x" >' + '</span></div>');
|
||||
// alert("submit");
|
||||
this.form.submit();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user