jquery - Capturing the tab key using JavaScript in Firefox -
i use following restricts user enter characters. when press tab, cursor not point next control (in mozilla). works fine in ie.
// restricts user enter characters other z, z , white space( ) // rauf k. 06.11.2010 $("input:text.characters_only").keypress(function(e) { if (!((e.which >= 65 && e.which <= 90) || (e.which >= 97 && e.which <= 122) || e.which == 32 || e.which == 8 || e.which == 9)) { return false; } });
i recommend trying e.keycode
instead of e.which
. here link describes method of getting key strike single variable regardless: jquery event keypress: key pressed?
Comments
Post a Comment