File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -178,6 +178,25 @@ function disabilitaSede(id){
178178 }
179179 });
180180
181+ // Gestione invio (Enter) direttamente nel campo barcode:
182+ // evita il submit del form e avvia la ricerca barcode, così l \'articolo viene caricato prima della validazione.
183+ $("#barcode").on("keydown", function (event) {
184+ let key = window.event ? event.keyCode : event.which;
185+
186+ if (key === 13) {
187+ event.preventDefault();
188+
189+ $("#articolo-missing").addClass("hidden");
190+
191+ let value = $(this).val() || "";
192+ let search = value.replace(/[^a-z0-9\s\-\.\/ \\|]+/gmi, "");
193+
194+ if (search !== "") {
195+ ricercaBarcode(search);
196+ }
197+ }
198+ });
199+
181200 // Reload pagina appena chiudo il modal
182201 $("#modals > div").on("hidden.bs.modal", function () {
183202 location.reload();
You can’t perform that action at this time.
0 commit comments