javascript regex for numpad -
i need capture pressed key 0-9 including numbers numpad. wrote function checks doesn't work on numpad digits
function getkeyval(e) { var order = string.fromcharcode(e.keycode); return /^\s*\d+\s*$/.test(order) } string.fromcharcode return "a" numpad key 1.
can help?
you can use onkeypress handler, or subtract 48 keycode. see question:
Comments
Post a Comment