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>
This commit is contained in:
parent
bfe67da62d
commit
07d212c024
1 changed files with 27 additions and 0 deletions
|
@ -281,6 +281,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 a new issue