I am working in javascript. I want to add validation on my text field that only characters are allowed.
along with characters, I allowed left arrow key which has keycode 37. But this is creating problem because keycode of % is also 37. And I dont want to allow % symbol.
Please suggest me how can I differenciate % and left arrow key , because both key code are 37 ?
If you press the ‘percent’ key the char code is 37, for the ‘left arrow’-key it’s not 37; e.g.:
Also see this jsfiddle.
=== UPDATE ===
For additional internet explorer support:
Also see this jsfiddle.