ppendo is a lightweight plugin to manage cloning form rows.
Appendo is less than 2000 bytes and is very easy to use.
Features
- Creates an interface to manage adding cloned form rows
- Remove button appears when added rows can be removed
- Optionally limit the number of rows that can be added
- Optionally focus first form field in added row
- Multiple easy-to-use attachment methods (no Javascript required)
- Lightweight, less than 2K! Well-commented source
- Self-contained Javascript file (no other files needed)
- Can be styled by CSS rules or via jQuery properties object
- Completely namespaced as jQuery.appendo
Introduction
Appendo aims to be a lightweight solution to duplicating form rows in a simple jQuery plugin format. The appendix includes some PHP example code for naming and reading rows.
Appendo also aims to be a succinct example of jQuery plugin design (see code).
Basic Usage
It’s very simple to attach Appendo.
In fact, it doesn’t even require any Javascript.
- Load jQuery and Appendo Javascript files in your page <head>
- Set up the row for duplication as the final row in a table
- You may use header rows or other layout in the table above the row
- Simply add class="appendo" to the table with to duplicate
If you’ve loaded jQuery and Appendo correctly, Appendo will automatically attach to tables withclass="appendo". It’s that easy!
Demo / Download