Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ptheofan/cool.inputfilter
jQuery widget that filters user input on textboxes
https://github.com/ptheofan/cool.inputfilter
Last synced: about 2 months ago
JSON representation
jQuery widget that filters user input on textboxes
- Host: GitHub
- URL: https://github.com/ptheofan/cool.inputfilter
- Owner: ptheofan
- Created: 2012-03-17T01:06:26.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2013-08-06T19:28:10.000Z (over 11 years ago)
- Last Synced: 2023-03-19T02:30:13.189Z (almost 2 years ago)
- Language: JavaScript
- Homepage:
- Size: 63.5 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.txt
Awesome Lists containing this project
README
FiterInput
author Paris Theofanidis ([email protected])
source https://github.com/ptheofan/cool.inputFilter
demo http://yeeha.pro/demo/textInput/
Fiter user input in textbox in during keyDown and keyPress events, thus
artifact free. This widget will properly handle selected text and paste events.
Tested Under: Chrome, Safari, FireFox, IE8, IE9
Options
regex: A RegExp object which will be used for testing. If null a validate
event will be fired.
Events:
beforeValidate -- an ideal place to remap user input
validate -- when a regex is not enough
afterValidate -- an ideal place to apply logic validation, beyond regex and keystrokes
KeyUp (overrides default) -- an ideal place to update your elements should you need toRegexes Cheatsheet (make pull requests should you want to add more)
UNSIGNED float with 2 decimal points max
^\d*$|^\d*(\.|\,)\d{0,2}$Example
$('#myTextbox').inputFilter({regex: new RegExp('^\\d*$|^\\d*(\\.|\\,)\\d{0,2}$')});