-
Notifications
You must be signed in to change notification settings - Fork 0
mattfreer/InputRestrictor
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
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/