10 examples of 'enter key press event in jquery in textbox' in JavaScript

Every line of 'enter key press event in jquery in textbox' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
this disclaimer
104function keyup(e,text)
105{
106 if(text.value.length == 3 && ((e.keyCode >47 && e.keyCode <58) ||(e.keyCode >95 && e.keyCode <106)))
107 text.form[(getIndex(text)+1) % text.form.length].focus();
108}
Important

Use secure code every time

Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code

297function bindEnterKeyForSearchBox() {
298 $('#searchQuery').keypress((e) => {
299 // 13 is the Unicode character code for enter key
300 if (e.keyCode === 13) {
301 $('#search').click();
302 }
303 });
304}
34onkey(event: KeyboardEvent) {
35 if (event.metaKey || event.shiftKey || event.ctrlKey || event.altKey) return;
36 if (event.type == 'keyup') {
37 if (event.key == 'Escape' && document.activeElement.outerHTML == this.inputfield.outerHTML) {
38 this.inputfield.blur()
39 }
40 if (event.key == '/' && document.activeElement.tagName != 'INPUT') {
41 this.inputfield.focus()
42 }
43 }
44 if (event.type == 'keydown' && document.activeElement.tagName != 'INPUT') {
45 if (event.code.startsWith('Key')) {
46 this.inputfield.focus()
47 this.query = (this.query || '') + event.key
48 }
49 }
50}
223function keyUp(e)
224{
225 if (e.keyCode != 13)
226 {
227 this._notifyChanged();
228 }
229}
59function globalKeyHandler(e) {
60 var handler = keyMap[e.which];
61 if (typeof handler === 'function') {
62 handler(e);
63 }
64}
83onKeyPressed(e) {
84 e = e || window.event;
85 if (e.key === 'Escape') {
86 // stop editing but keep selection
87 this.stopEditing();
88 e.preventDefault();
89 }
90}
243function pressUpKey(elem) {
244 doKeyDown(keyCodes.UP, elem);
245}
481function handleKeyTextbox(target, keyCode, altKey) {
482 var combo;
483 /* keydown happens when a combo input is focused */
484 if (keyCode === KeyEvent.DOM_VK_TAB) {
485 // TAB out, do nothing, focus will take care of it.
486 return false;
487 }
488
489 combo = getCombo(target);
490 if (!combo) {
491 return false;
492 }
493
494 switch (keyCode) {
495 case KeyEvent.DOM_VK_ESCAPE:
496 if (shed.isExpanded(combo)) {
497 shed.collapse(combo);
498 return true;
499 }
500 break;
501 case KeyEvent.DOM_VK_DOWN:
502 doDownButton(combo, altKey);
503 break;
504 case KeyEvent.DOM_VK_UP:
505 doUpKey(combo, altKey);
506 break;
507 default:
508 if (filter && (!key.isMeta(keyCode)) && !CHATTY_COMBO.isOneOfMe(combo)) {
509 filterOptions(combo);
510 }
511 }
512 return false;
513}
99function keydown(e,text)
100{
101 if((e.keyCode == 190 || e.keyCode == 110) && text.value.length !=0 && SelectionTextLength(text)==0)
102 text.form[(getIndex(text)+1) % text.form.length].focus();
103}
86function keyDown(e) {
87 if (e.keyCode == 87 || e.keyCode == 38) {//Arrow Up
88 this.keys.up = 1;
89
90 }else if (e.keyCode == 83 || e.keyCode == 40) {//Arrow Down
91 this.keys.down = 1;
92
93 } else if (e.keyCode == 65 || e.keyCode == 37) {//Arrow Left
94 this.keys.left = 1;
95
96 } else if (e.keyCode == 68 || e.keyCode == 39) {//Arrow Right
97 this.keys.right = 1;
98 }
99}

Related snippets