Skip to content
This repository has been archived by the owner on Dec 12, 2021. It is now read-only.

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);
    }
  });
});