Js does not recognize accented characters onclick

I have an input element that has an onkeyUp binding. The problem I'm running into is that when the user enters the accented characters, ie: Ä ä Ö ö Ü ü JS does not fire the onkeyup event / function. it works fine on regular characters. Also, if I enter an accented char and a regular char (Ös), bind recognizes both charecters and fires the event / function. Also, copy-pasting an accented char works great. Any ideas?

+3


source to share


2 answers


Well ... I found that the accented charecters end up in my JS file as keyCode = 0, and so I ignored them. added new rule for: (event.keycode == 0) Tnx again.



0


source


I am using a Swiss keyboard and you are correct: the event keyup

returns the same value for characters é

and ö

that are provided from the same key ( ö

activated shift

).



You can use event keypress

to catch all keyboard events including special keys: http://api.jquery.com/keypress/

0


source







All Articles