I'm using the plugin from jquery.cloneya
which is a plugin to clone forms that were already included in an template of an admin panel I am using. I did not quite understand how to use the hook of this plugin to increment the name of an input whenever it is cloned .
For example: Click on the "+" sign and clone one or two fields together. These two fields have their name incremented this way > " name='produtos[qtd][2]'
", the index of the first input beginning with " [qtd][0]
".
I asked the developer of the plugin if it was possible to make the clone and increment the names and he replied the following:
"Yes, it is. Ideally, due to the nature of cloned form elements, the names should be name [], so that the values can be processed as arrays. can plug into the custom event - clone_form_input
.
See: link .