Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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: about 2 months ago
JSON representation

bootstrap plugin to add a (x) clear button to your input fields

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"
})
```