Bug 37836: Prevent submitting empty barcodes in Self check-in
This patch disbles the "Submit" button when the barcode field is empty.
To test this patch:
Add the patch to your koha clone
Enable the "SelfCheckInModule".
Open the page and the "Submit" button should be disabled when the barcode field is empty.
Signed-off-by: Sam Sowanick <sam.sowanick@corvallisoregon.gov>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 07d212c024)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
parent
9cc99b3eaf
commit
26cbf2492d
|
|
@ -298,6 +298,33 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function checkBarcodeInput() {
|
||||
var inputField = document.getElementById("barcode_input");
|
||||
var button = document.getElementById("sci_append_button");
|
||||
|
||||
if (inputField.value.trim() === "") {
|
||||
button.disabled = true;
|
||||
} else {
|
||||
button.disabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
checkBarcodeInput();
|
||||
|
||||
document.getElementById("barcode_input").addEventListener("input", checkBarcodeInput);
|
||||
|
||||
document.getElementById("sci_append_button").addEventListener("click", function() {
|
||||
setTimeout(checkBarcodeInput, 10);
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
[% IF ( Koha.Preference('SelfCheckInUserJS') ) %]
|
||||
|
|
|
|||
Loading…
Reference in New Issue