Add Field
Add Field dynamic fields creation.
How to use
Copy-paste the following <script>
near the end of your pages under JS Implementing Plugins to enable it.
<script src="../assets/vendor/hs-add-field/dist/hs-add-field.min.js"></script>
Copy-paste the init function under JS Plugins Init., before the closing </body>
tag, to enable it.
<script>
$(document).on('ready', function () {
// initialization of hs-add-field
$('.js-add-field').each(function () {
new HSAddField($(this)).init();
});
});
</script>
Example
With libraries
This example uses Input mask and Select libraries.
Modal example
Methods
Parameters | Description | Default value |
---|---|---|
createTrigger |
Trigger for add fields. | .js-create-field |
deleteTrigger |
Trigger for delete field. | .js-delete-field |
limit |
Limit of the fields. | 10 |
defaultCreated |
Count created by default fields. | 1 |
nameSeparator |
Separator for name attribute. | _ |
addedField |
Call when field is added. | function() {} |
deletedField |
Call when field is removed. | function() {} |