2017 © Pedro Peláez
 

library form-tools

Plugin simple cloning of nodes by template

image

artroot/form-tools

Plugin simple cloning of nodes by template

  • Friday, June 30, 2017
  • by artroot
  • Repository
  • 1 Watchers
  • 0 Stars
  • 0 Installations
  • JavaScript
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

form-tools

The simple cloning of node by template., (*1)

  • Declarative style of defining bindings and rules;
  • Flexibility of template.

Try to use formTools when you need to generate fields in your input form, for example massive of users / items., (*2)

Example

Clone pattern attributes description:

  • cp-init - the initialization area of the form or block;
  • cp-options - list of options and rules;
  • cp-viewport - the area where the cloned nodes will be added;
  • cp-template - the cloned template;
  • cp-inputs - area of input fields, in which data will be inserted;
  • cp-add - the button for adding a cloned node;
  • cp-rm - delete node button
  • cp-counter - node counter

Just follow this structure:

<form cp-init="userList" cp-options="{minNode:1}">
    <span cp-add>Clone</span>
    <div cp-viewport>
        <div cp-template>
            <div cp-inputs>
                <label cp-counter>1</label>
                    <input type="text" name="name[]">
                    <input type="email" name="email[]">
                    <span cp-rm></span>
            </div>
        </div>
    </div>
</form>

More examples and documentation you can see in my website https://docs.artsemenishch.com.ua/projects/js/form-tools/, (*3)

Installation

With composer

composer require artroot/form-tools, (*4)

Regular Setup

To install formTools, just download the form-tools.min.js script and add into your head tag., (*5)

<script src="path/to/form-tools.min.js"></script>

or use these links., (*6)

<script src="https://libs.artsemenishch.com.ua/js/form-tools/form-tools.min.js"></script>

License

This project is licensed under the MIT License - see the LICENSE file for details, (*7)

The Versions

30/06 2017

dev-master

9999999-dev https://github.com/artroot/form-tools#readme

Plugin simple cloning of nodes by template

  Sources   Download

MIT

form tools clone clonenode