jQuery validation plugin .. was causing ff2 to choke. It also didn't have a multiple-email validator .. or a split-up phone validator -- although on that last one, I highly advise you push back - a phone # field should just be ONE INPUT.
Showing posts with label jquery plugin. Show all posts
Showing posts with label jquery plugin. Show all posts
Wednesday, July 8, 2009
Wednesday, April 22, 2009
Don't Leave Keyboarders in the Cold
A handy jQuery plugin to make it easier to play nice with the keyboard-centric folks and improve accessibility
This code assumes the definition of a 'keys' object that identifies keycodes by more readable names, such as keys = {space:32, enter:13};
// make a new plugin that handles click + keypress,
// assuming that hitting space or enter counts as a 'click'.
$.fn.klik = function(f){
return this.bind('click keypress', function(e){
if(!e.keyCode || e.keyCode == keys.space || e.keyCode == keys.enter){
return f.call(this, e);
}
});
};
Labels:
accessibility,
jquery,
jquery plugin,
keyboard,
plugin
Subscribe to:
Posts (Atom)