Description: A JavaScript Trait which can be used to apply char restrictions on a Form Input (text) element. Dependencies: underscore.js: http://documentcloud.github.com/underscore/ traits.js : http://traitsjs.org/ Usage: var restrictor = Trait.create(this, new TInputRestrictor()) restrictor.restrict($('#decimal_txt'), /[0-9.\-]/, /^-{0,1}\d*[.]?\d{0,2}$/); Example of use in a Backbone View: http://jsfiddle.net/mattfreer/5SFpG/