Yapapaya / jquery-cloneya

A jquery plugin to clone DOM elements
MIT License
76 stars 28 forks source link

How do I make the input names increase incrementally? #44

Closed BenComicGraphics closed 9 years ago

BenComicGraphics commented 9 years ago

I'm using this, and I need a way to ensure the input names increase like the ID's are.

gchokeen commented 9 years ago

Cloneya already handlng it, You need to set field name as array <input type="text" name="name[1]"/>. Cloneya will automatically increment the numeric index of array.

BenComicGraphics commented 9 years ago

Got it! tHX!

girlscancode commented 9 years ago

Hi gchokeen,

OK, I think this is not working - and I am looking at the actual demo page you have set up, the name field is not automatically incremented

Best, Gabriela

acoulton commented 9 years ago

You also need to set the (undocumented) config option serializeIndex to true to make it work. Note also that currently if you have more than one numeric bit in your fieldname cloneya will reset all of them to the clone index (see #42)

girlscancode commented 9 years ago

Aaah, ok, I see! Thanks Andrew!

shibin-pb commented 3 years ago

serializeIndex is not incrementing properly and it stops the numeric indexing of input array at 10 when clone count becomes more than 10

`

`