DubFriend / jquery.repeater

Create a repeatable group of input elements
MIT License
390 stars 193 forks source link

input names #62

Open rakelcoelho opened 7 years ago

rakelcoelho commented 7 years ago

How can I have the input's names personalized? I have a name attribute in the inputs but I always get, for example, «group[1][text-input]». For example. I have:

and it gets

How can I change it?

Thank you so much

faiq-naseem commented 7 years ago

Just change div data-repeater-list="group-a" to your personalized one.

zohaibtariq commented 6 years ago

i am repeating these rows

<form id="form">
<td class="user">
    <input name="users[0][user_name]" type="text" class="form-control user_search ui-autocomplete-input" id="" placeholder="Enter your name" autocomplete="off">
    <input class="user_id" name="users[0][user_id]" type="hidden" value="3">
</td>
<td class="user">
    <input name="users[1][user_name]" type="text" class="form-control user_search ui-autocomplete-input" id="" placeholder="Enter your name" autocomplete="off">
    <input class="user_id" name="users[1][user_id]" type="hidden" value="3">
</td>
</form>

now when i post ajax and i am passing form data serialized like that data: $("form#form").serialize(), i got this at my server look at last name

aum_charges[

why this bracket added to keys ???????? and its happening on last index row look at json

{"_token":"WhS9BPtgrlxW0ePm9tbCkb4d237EggtnGuBqj7in","code":"rep1-0001","status":"1","deactivate_reason":null,

"users": [ {"user_name":"Yoga","user_id":"3","split_percentage":null,"triad_oversite":null,"compliance_fee":null,"aum_charges":null,"house_percent":null},

{"user_name":null,"user_id":null,"split_percentage":null,"triad_oversite":null,"compliance_fee":null,"aum_charges":null,"house_percent":null},

{"user_name[":"Zoya","user_id[":"2","split_percentage[":null,"triad_oversite[":null,"compliance_fee[":null,"aum_charges[":null,"house_percent[":null}

] }

look at keys appended with large brackets [ why dude ?

this is also happening on your master branch :(

aliChavoshi commented 3 years ago

Find a solution?

Get455by commented 1 year ago

Just change div data-repeater-list="group-a" to your personalized one.

Thanks! you made my day!)