DubFriend / jquery.repeater

Create a repeatable group of input elements
MIT License
389 stars 191 forks source link

Help with multiple input text arrays #122

Open KovaZg opened 4 years ago

KovaZg commented 4 years ago

I have two repeater groups, example:

<div data-repeater-list="group-a">
<div data-repeater-item style="margin:4px;">
<input type="text" name="first_name" placeholder="Name" value=""/>
<input type="text" name="last_name" value="Surname" placeholder=""/> a.g.
<input type="checkbox" name="gdpr" value="1" ?>/>
<input data-repeater-delete type="button" class="button" value="Delete"/>
</div>
</div>
  <input data-repeater-create type="button" class="button" value="Add user"/>

As this is repeater, and I get multiple names, checkboxes, if I put:

<div data-repeater-item style="margin:4px;">
<input type="text" name="first_name" placeholder="Name" value=""/>
<input type="text" name="last_name" value="Surname" placeholder=""/> a.g.
<input type="checkbox" name="gdpr" value="1" ?>/>
<input data-repeater-delete type="button" class="button" value="Delete"/>
</div>
</div>
  <input data-repeater-create type="button" class="button" value="Add user"/>

If I click few times I get: I get group-a[0]group-a[0]group-a[0][first_name]....