(function($){ $.fn.alphanumeric = function(p) { p = $.extend({ ichars: "!@#$%^&*()+=[]\\\';,/{}|\":<>?~`.- ", nchars: "", allow: "" }, p); return this.each ( function() { if (p.nocaps) p.nchars += "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; if (p.allcaps) p.nchars += "abcdefghijklmnopqrstuvwxyz"; s = p.allow.split(''); for ( i=0;i this.size) this.value = this.value.substring(0,this.size); }) } ); }; $.fn.numeric = function(p) { var az = "abcdefghijklmnopqrstuvwxyz"; az += az.toUpperCase(); p = $.extend({ nchars: az }, p); return this.each (function() { $(this).alphanumeric(p); } ); }; $.fn.alpha = function(p) { var nm = "1234567890"; p = $.extend({ nchars: nm }, p); return this.each (function() { $(this).alphanumeric(p); } ); }; })(jQuery);