Questions tagged [onkeyup]

This is a JavaScript event that fires upon releasing a keyboard key.

This is a JavaScript event that fires upon releasing a keyboard key.

482 questions
135
votes
26 answers

Count characters in textarea

I want to count characters in a textarea, so I just made: function countChar(val){ var len = val.value.length; if (len >= 500) { val.value = val.value.substring(0,…
Kyle
  • 1,385
  • 2
  • 9
  • 8
96
votes
9 answers

What are the options for (keyup) in Angular2?

The following works great when the enter key is released. What other options are available for the keyup in addition to keyup.enter?
AlikElzin-kilaka
  • 34,335
  • 35
  • 194
  • 277
50
votes
3 answers

jQuery key code for command key

I have read jQuery Event Keypress: Which key was pressed? and How can i check if key is pressed during click event with jquery? However my question is if you can get the same key event for all browsers? Currently I know that Firefox gives the…
Craig
  • 3,043
  • 8
  • 24
  • 25
29
votes
9 answers

Change color of specific words in textarea

I'm building a Sql query builder and would like to change the text color of a word in a textarea when the user types in words like SELECT, FROM, WHERE. I've searched around a bit and beyond this (https://jsfiddle.net/qcykvr8j/2/) I unfortunately do…
user4579153
20
votes
7 answers

Android Development: How To Use onKeyUp?

I'm new to Android development and I can't seem to find a good guide on how to use an onKeyUp listener. In my app, I have a big EditText, when someone presses and releases a key in that EditText I want to call a function that will perform regular…
AlexPriceAP
  • 1,987
  • 6
  • 26
  • 41
16
votes
5 answers

JQuery: Keyup, how do I prevent the default behavior of the arrow (up & down) and enter key?

JavaScript (JQuery) $('input').keyup(function(e) { var code = e.keyCode ? e.keyCode : e.which; switch(code) { case 38: break; case 40: break; case 13: break; default: …
user317005
16
votes
2 answers

Upgraded to AppCompat v22.1.0 and now onKeyDown and onKeyUp are not triggered when menu key is pressed

I've just upgraded my app to use the newly released v22.1.0 AppCompat and now onKeyDown and onKeyUp are not triggered when menu key is pressed. The other keys correctly trigger onKeyDown and onKeyUp, but when i press the menu key nothing happens. If…
Mattia Maestrini
  • 32,270
  • 15
  • 87
  • 94
14
votes
6 answers

jQuery KeyUp and Click

I was wondering how you can do .keyup() and .click() for the same #id? i.e. essentially I want to validate the #id when both the user attempts to hit enter or hits the #search button. Thanks alot
Tom
  • 143
  • 1
  • 1
  • 4
14
votes
3 answers

Angular 2+ elegant way to intercept Command+S

Trying to implement a shortcut key combination for Command+S to save a form. I've read this - https://angular.io/guide/user-input, but it does not say anything about meta or command. Tried surrounding the form with:
KarolDepka
  • 8,318
  • 10
  • 45
  • 58
12
votes
2 answers

Simple way to count characters using .keyup in jQuery

How can I write the number of characters from input on .keyup in JavaScript/jQuery?
UserIsCorrupt
  • 4,837
  • 15
  • 38
  • 41
12
votes
7 answers

Multiple keyup events in one JS FILE

I have a JS file for my HTML web page. I want to have 4 things to check. If they hit a number, 1-4 on the keypad, it takes them to a specified url. The script works, but only if I have one. When I put all 4 events in the js file, only the last…
12
votes
2 answers

How to detect if the Up button was pressed

In my activity the action bar shows only the left arrow and the title of the activity. When I press the left arrow the activity goes back to the previous activity, but no event is registered in the onKeyUp, OnkeyDown and OnBackPressed methods. But…
Zvi
  • 2,354
  • 2
  • 26
  • 37
11
votes
5 answers

Can I delay the keyup event for jquery?

I'm using the rottentomatoes movie API in conjunction with twitter's typeahead plugin using bootstrap 2.0. I've been able to integerate the API but the issue I'm having is that after every keyup event the API gets called. This is all fine and…
Paul
  • 11,671
  • 32
  • 91
  • 143
11
votes
1 answer

jquery bind keyup to body in firefox

i m binding keyup function in jquery to body which works in every browser except firefox the code: - $('body').bind('keyup', function(e) { //alert ( e.which ); alert('testing'); }); how do i do it for firefox. it does not responds at…
Pradyut Bhattacharya
  • 5,440
  • 13
  • 53
  • 83
11
votes
6 answers

How can I check the new value of a text field on keypress?

I have a single form field and I need to be able to detect when the field changes and execute some additional code using the new value of the field. I only want to execute the code if the key pushed actually changes the value of the text box. Here's…
Stephen Sorensen
  • 11,455
  • 13
  • 33
  • 46
1
2 3
32 33