cjheath/jquery.key — Issue #2: Docs unclear how to tie to specific elements
Author: scottbernardi
Created: 2011-11-17 19:29:28+00:00
State: open

I want to filter keystrokes in conjunction with jQuery.validate; for example, restricting input to digits and dash for a US phone number. I used this:

$('input.phoneUS:text').keypress(function(evt) {
return checkKeys(evt, validIntChars);
});

to attach my checkKeys filter but run into the problem with the DEL key and decimal (dot) being interpreted as the same. I found your plugin which looks perfect.
However, how do I go about attaching it to specific elements instead of the keypress event as above?