+ 2

Key event key not recognized

The key returned by event. key is always unidentified. Only enter key is identified. This happens on codeplayground. https://code.sololearn.com/W9xLWlbj6F35/?ref=app

23rd Oct 2018, 6:53 AM
Asgar Ali
Asgar Ali - avatar
5 odpowiedzi
+ 3
There is a mistake in line 3. Change from key to keyCode
23rd Oct 2018, 8:47 AM
Googel
Googel - avatar
+ 1
I have tried with all possible combinations keycode, charCode, which, key, on my android phone It never gives the correct answer.
23rd Oct 2018, 12:08 PM
Asgar Ali
Asgar Ali - avatar
+ 1
Just make the "keycode" camel type forma. Change it from "keycode" to "keyCode" so it would work. Remember, JavaScript is case sensitive.
23rd Oct 2018, 4:54 PM
Virus5600
Virus5600 - avatar
+ 1
Changed keycode to keyCode. Now it recognizes enter key and sometimes backspace key. It returns 229 for all the other keys(alphabets and numbers)
23rd Oct 2018, 6:13 PM
Asgar Ali
Asgar Ali - avatar
0
I see it works with Input type =number what's the problem with input type = text
24th Oct 2018, 11:09 AM
Asgar Ali
Asgar Ali - avatar