Skip to content
Snippets Groups Projects
Commit 5e11d8f4 authored by Benjamin Bertrand's avatar Benjamin Bertrand
Browse files

Prevent enter key to submit the form

We don't want to submit the form when scanning a code bar or ICS id.
In keyboard mode, the scanner sends a CR as last character.
parent 5ba62759
No related branches found
No related tags found
No related merge requests found
$(document).ready(function() {
// Prevent enter key to submit the form
// When scanning a code bar, the scanner usually
// send a CR as last character. We don't want that
// to submit the form.
$(window).keydown(function(event) {
if(event.keyCode == 13) {
event.preventDefault();
return false;
}
});
// Focus to ICS id when loading the page
$("#ics_id").focus();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment