what i want to do is ensure that ” ‘ are characters that do not get typed into the input box I have a variety of key-press codes that restrict users to a-z and 0-9 but some how i cannot seem to make it work in a manner that i can restrict to not typing a few characters rather than specifying what needs to be typed.
http://jsfiddle.net/cG4aV/ – tryign to restrict enter key (works) , ” ‘ (does not work)
it also does not work for any key that activates with a shift…
any ideas
I see it works on Chrome, but not on Firefox. Try replacing
keyCodeforwhich, it’s normalized for all browsers.Updated fiddle, should work in both browsers now.
Quoting jQuery docs on event.which:
So, it’s enough to test for
which, no need to checkkeyCodeorcharCode.