Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/interactive-pioneers/iptools-jquery-populator
jQuery plugin that populates form control value(s) to other control(s)
https://github.com/interactive-pioneers/iptools-jquery-populator
form iptools-jquery-populator javascript jquery jquery-plugin population
Last synced: 8 days ago
JSON representation
jQuery plugin that populates form control value(s) to other control(s)
- Host: GitHub
- URL: https://github.com/interactive-pioneers/iptools-jquery-populator
- Owner: interactive-pioneers
- License: gpl-3.0
- Created: 2014-08-28T12:23:50.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2017-05-10T09:42:10.000Z (over 7 years ago)
- Last Synced: 2024-10-09T22:33:59.779Z (about 1 month ago)
- Topics: form, iptools-jquery-populator, javascript, jquery, jquery-plugin, population
- Language: JavaScript
- Homepage:
- Size: 63.5 KB
- Stars: 0
- Watchers: 14
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# iptools-jquery-populator [![Build Status](http://img.shields.io/travis/interactive-pioneers/iptools-jquery-populator.svg)](https://travis-ci.org/interactive-pioneers/iptools-jquery-populator) [![Bower version](https://badge.fury.io/bo/iptools-jquery-populator.svg)](http://badge.fury.io/bo/iptools-jquery-populator)
jQuery plugin that populates form control value(s) to other control(s).
## Installation
```
bower install iptools-jquery-populator
```## Features
- Populate values automatically from one form control to the other on its `change` or `blur` events based on `data-population-target` attribute
- Populate values manually from one form control to the other with `populateManual()` method call based on `data-population-target-manual` attribute
- Listen to population to retrieve event `type`, `source` and `target` controls of the population
- Populate single value to multiple targets## Options
All options are delivered over data attributes on form controls which values should be populated to other control(s).
| Option | Description |
| ------ | ----------- |
| `data-population-target` | Single or comma-separated list of selectors for form controls receiving data on `change` or `blur` events |
| `data-population-target-manual` | Single or comma-separated list of selectors for form controls receiving data on `populateManual()` method call |## Events
Events are dispatched on element that populator was initialised on, e.g. ``.
| Event | Description |
| ------ | ----------- |
| `success` | Dispatched whenever value was populated successfully. |
| `error` | Dispatched whenever values was popuplated erroneously. |Event structure:
```js
{
type: '', // populationMismatch or populationSuccess
target: '', // target element receiving populated value
source: '', // source element defining populated
}
```## Requirements
- jQuery 1.3.2 or greater
## Example
```html
jQuery(document).ready(function($) {
$('form:first').iptPopulator();
});```
## Contributions
### Bug reports, suggestions
- File all your issues, feature requests [here](https://github.com/interactive-pioneers/iptools-jquery-populator/issues)
- If filing a bug report, follow the convention of _Steps to reproduce_ / _What happens?_ / _What should happen?_
- __If you're a developer, write a failing test instead of a bug report__ and send a Pull Request### Code
1. Fork it ( https://github.com/[my-github-username]/iptools-jquery-populator/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Develop your feature by concepts of [TDD](http://en.wikipedia.org/wiki/Test-driven_development), see [Tips](#tips)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request### Tips
Following tasks are there to help with development:
- `grunt watch:bdd` listens to tests and source, reruns tests
- `grunt qa` run QA task that includes tests and JSHint
- `grunt build` minify source to dist/## Licence
Copyright © 2015 Interactive Pioneers GmbH. Licenced under [GPLv3](LICENSE).