JQuery plugin for input text field filtering | jquery filter input text
ThisissimpleJQuerypluginforfilteringtextinputfieldbyusingregexp.Onlyallowedcharacterswillbeinsertedintoinputfield,otherswillbesilentlydropped.Usageexample //onlylowercasealphabetsareallowed$(#text_input).filter_input({regex:[a-z]}); //onlynumbersareallowed$(#text_input).filter_input({regex:[0-9]}); //onlyURLsafecharactersareallowed$(#text_input).filter_input({regex:[a-zA-Z0-9_]}); //uselive()forbindingtoelements-fromversion1.1.0$(.input).filter_input({regex:[a-z],live:tr...
This is simple JQuery plugin for filtering text input field by using regexp. Only allowed characters will be inserted into input field, others will be silently dropped.
Usage example// only lowercase alphabets are allowed$(#text_input).filter_input({regex:[a-z]});
// only numbers are allowed$(#text_input).filter_input({regex:[0-9]});
// only URL safe characters are allowed$(#text_input).filter_input({regex:[a-zA-Z0-9_]});
// use live() for binding to elements - from version 1.1.0$(.input).filter_input({regex:[a-z], live:true});
// use callback function "feedback" when key test is negative - from version 1.3.0$(.input).filter_input({ regex:[a-z], feedback: function(char) { // "this" contains a reference to the inputfield alert(character + char + is not allowed in input + $(this).attr(id)); } });
// filter now support...