jQuery Plugin To Dynamically Add More Form Fields czMore - Download jQuery Plugin To Dynamically Add More Form Fields - czMore

Download jQuery Plugin To Dynamically Add More Form Fields – czMore

Posted on

This time I will share jQuery Plugin and tutorial about jQuery Plugin To Dynamically Add More Form Fields – czMore, hope it will help you in programming stack.

jQuery Plugin To Dynamically Add More Form Fields czMore - Download jQuery Plugin To Dynamically Add More Form Fields - czMore
File Size: 13.3 KB
Views Total: 32679
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

czMore is an easy-to-use jQuery plugin that allows to dynamically duplicate and add/remove groups of fields from a specific form as needed.

How to use it:

1. Load the latest version of jQuery library and the jQuery czMore plugin’s script at the end of your html document.

1 <script src="//code.jquery.com/jquery.min.js"></script>
2 <script src="js/jquery.czMore.js"></script>

2. Create the first group of form fields you want to duplicate. The form fields could be any types of form elements such as inputs, selects, checkboxes, etc.

1 <div id="czContainer">
2   <div id="first">
3     <div class="recordset">
4       <input type="text" name="input 1" id="input 1">
5       <input type="text" name="input 2" id="input 2">
6       <input type="text" name="input 3" id="input 3">
7     </div>
8   </div>
9 </div>

3. Just initialize the plugin by call the function on the top container and we’re done.

1 $("#czContainer").czMore();

4. Default plugin options and callbacks.

01 $("#czContainer").czMore({
02  
03   // maximum number of form fields allowed
04   max: 5,
05  
06   // minimum number of form fields allowed
07   min: 0,
08  
09   // uses your own CSS styles
10   styleOverride: false,
11  
12   // change the prefix name of the text field
13   countFieldPrefix: '_czMore_txtCount'
14    
15 }

5. Callback functions & event handlers.

01 $("#czContainer").czMore({
02  
03   onLoad: function(index) {
04     // on load
05   },
06  
07   onAdd: function(index) {
08     // on add
09   },
10  
11   onDelete: function(id) {
12     // on delete
13   }
14    
15 }

Changelog:

2019-07-15

  • fixing bugs introduced with “use strict”

v1.6.0 (2019-07-14)

  • Added new option: “max”
  • Added new Option “countFieldPrefix”

2018-01-09

  • Make compatible with latest jquery version & add styling functionailty

This awesome jQuery plugin is developed by cozeit. For more Advanced Usages, please check the demo page or visit the official website.

source : jquery.net