Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gesquive/bootstrap-add-clear
bootstrap plugin to add a (x) clear button to your input fields
https://github.com/gesquive/bootstrap-add-clear
bootstrap forms
Last synced: 7 days ago
JSON representation
bootstrap plugin to add a (x) clear button to your input fields
- Host: GitHub
- URL: https://github.com/gesquive/bootstrap-add-clear
- Owner: gesquive
- License: mit
- Created: 2015-03-30T14:41:45.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2019-07-19T06:30:50.000Z (over 5 years ago)
- Last Synced: 2024-10-12T01:07:29.902Z (about 1 month ago)
- Topics: bootstrap, forms
- Homepage: http://gesquive.github.io/bootstrap-add-clear
- Size: 242 KB
- Stars: 36
- Watchers: 4
- Forks: 9
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
**Maintainer:** Gus Esquivel
**Plugin Website:** http://gesquive.github.io/bootstrap-add-clear
**Contributers:**
Stephen Korecky,
scoman81,
Steve887,
Deividy,
zarv1k,
grrizzly,
adambiggs,
Vladekk,
denisj,
starspoint
## About
This project is a fork of Stephen Korecky's "[Add Clear](https://github.com/skorecky/Add-Clear)" project. It is meant to work as a drop-in replacement when using bootstrap.## Getting Started
How you acquire bootstrap-add-clear is up to you.
#### Bower
Install with [Bower](http://bower.io/):
```bash
bower install bootstrap-add-clear
```#### NPM
Install with [NPM](http://npmjs.org):
```bash
npm install bootstrap-add-clear
```If you are using [browserify](http://browserify.org/) to bundle, you will have to expose jQuery globally:
***entry.js***
```javascript
var $ = require('jquery');
global.jQuery = $;
require('bootstrap-add-clear');
```#### Github
Clone the [boostrap-add-clear repository](https://github.com/gesquive/bootstrap-add-clear/):
```bash
git clone [email protected]:gesquive/bootstrap-add-clear.git
```#### Direct Download
* [zip](https://github.com/gesquive/bootstrap-add-clear/archive/v1.0.7.zip)
* [tarbell](https://github.com/gesquive/bootstrap-add-clear/archive/v1.0.7.tar.gz)
* Individual Files
* [bootstrap-add-clear.js](https://raw.githubusercontent.com/gesquive/bootstrap-add-clear/v1.0.7/bootstrap-add-clear.js)
* [bootstrap-add-clear.min.js](https://raw.githubusercontent.com/gesquive/bootstrap-add-clear/v1.0.7/bootstrap-add-clear.min.js)**Note**: bootstrap-add-clear has a dependency on jquery 1.8+ and Bootstrap 3
### Available Options
Option
Type
Default
closeSymbol
string
symbolClass
string
glyphicon glyphicon-remove-circle
wrapperClass
string
top
number
0
right
number
0
returnFocus
boolean
true
showOnLoad
boolean
false
clearOnEscape
boolean
true
hideOnBlur
boolean
false
zindex
number
100
onClear
function
null
#### Using Options
```javascript
$("input").addClear({top : -2, right : 6});// Example onClear option usage
$(":input").addClear({
onClear: function(){
alert("call back!");
}
});// Example font awesome icon usage
$(":input").addClear({
symbolClass: "fa fa-times-circle"
})
```