Permalink
Browse files

Updated examples, readme, and the script itself. AddAnother no longer…

… adds brackets for you, but will modify them with the counter value.
  • Loading branch information...
1 parent 4df9683 commit 8b7e2a5f02d59b3480e9de8362c3c30d3b8ff381 @jeremeamia jeremeamia committed Apr 19, 2010
Showing with 361 additions and 256 deletions.
  1. +26 −14 README.markdown
  2. +193 −176 addAnother.jquery.js
  3. +111 −0 complex-test.html
  4. +0 −66 test.html
  5. +31 −0 uploader-test.html
View
@@ -8,20 +8,32 @@ multiple file uploaders.
**Author:** Jeremy Lindblom \<<http://webdevilaz.com>\>
-**Credits:** A fork of relCopy by Andres Vidal \<<http://www.andresvidal.com/labs/relcopy.html>\>
+**Note:** This is a fork of *relCopy* by Andres Vidal \<<http://www.andresvidal.com/labs/relcopy.html>\>
## Settings
-- limit - The number of items that can exist in the group. 0 = unlimited
-- excludeSelector - Elements with this class will not be cloned
-- emptySelector - Elements with this class will have subelements removed
-- clearInputs - If true, then cloned input fields will have an empty value
-- makeInputArrays - If true, input fields will have [] added to the name for array access
-- animate - If true, show/hide funcion are used with animation
-- allowRemove - If true, then a remove link will be added automatically
-- removeClass - The class of the remove link
-- addLinkText - The text of the add another link
-- removeLinkTex - The text of the remove link
-- onFull - A callback to be executed after an item is added and the group is full
-- onNotFull - A callback to be executed after an item is added and the group is NOT full
-- onRemove - A callback to be executed after an item is removed
+- **limit** - The number of items that can exist in the group. 0 = unlimited
+- **excludeSelector** - Elements with this class will not be cloned
+- **emptySelector** - Elements with this class will have subelements removed
+- **clearInputs** - If true, then cloned input fields will have an empty value
+- **animate** - If true, show/hide funcion are used with animation
+- **allowRemove** - If true, then a remove link will be added automatically
+- **removeClass** - The class of the remove link
+- **addLinkText** - The text of the add another link
+- **removeLinkText** - The text of the remove link
+- **onFull** - A callback to be executed after an item is added and the group is full
+- **onNotFull** - A callback to be executed after an item is added and the group is NOT full
+- **onRemove** - A callback to be executed after an item is removed
+
+## Usage
+
+In order to use AddAnother you must first include jQuery and the
+`addAnother.jquery.js` script in your page. Create a chunk of HTML you would
+to be able to replicate and give it a class. Then add some javascript:
+
+ $('.the-class-of-the-html-chunk').addAnother({...});
+
+where "&hellip;" is the options. You can have more than one AddAnother on one
+page. AddAnother does not automatically add brackets to your HTMl names, so you
+must do this yourself if you plan on using the posted data as an array. Take a
+look at the examples for more details.
Oops, something went wrong. Retry.

0 comments on commit 8b7e2a5

Please sign in to comment.