Skip to content

How To: Add multiples fields with one click

Gabriel edited this page Mar 2, 2015 · 3 revisions

Using javascript events you could add multiple fields with one click, e.g. add 3 fields at once:

jQuery(function ($) {
  $(document).on('nested:fieldAdded', function (event) {
    for (var n = 2; n; n--) {
      event.field.clone().insertAfter(event.field);
    }
  });
});