Skip to content
This repository has been archived by the owner on Oct 2, 2019. It is now read-only.

Commit

Permalink
Allow code39 barcodes to scan
Browse files Browse the repository at this point in the history
  • Loading branch information
James Glover committed Feb 13, 2019
1 parent a61526e commit 9d280fb
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions public/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -297,12 +297,9 @@
$(document).on("keydown", ".plate-barcode", function(event) {
var code=event.charCode || event.keyCode;
// Check for carrage return (key code 13)
if (code==13) {
// Check that the value is 13 characters long like a barcode
if ($(event.currentTarget).val().length === 13) {
$(event.currentTarget).closest('form').find('.show-my-plates').val(false);
$(event.currentTarget).closest('.plate-search-form').submit();
}
if (code == 13) {
$(event.currentTarget).closest('form').find('.show-my-plates').val(false);
$(event.currentTarget).closest('.plate-search-form').submit();
}
});

Expand Down

0 comments on commit 9d280fb

Please sign in to comment.