<p dir="auto">To improve the API docs and to reduce duplicated documentation work, it seems to be useful to link to certain parts of the documentation from the API docs (for example, as stated in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="49091816" data-permission-text="Title is private" data-url="https://github.com/symfony/symfony/issues/12496" data-hovercard-type="pull_request" data-hovercard-url="/symfony/symfony/pull/12496/hovercard" href="https://github.com/symfony/symfony/pull/12496">#12496</a>, linking to the cookbook that explains how to use Form events easily adds additional value to the API docs of the existing events without the need to duplicate information).</p>
<table role="table">
<thead>
<tr>
<th>Q</th>
<th>A</th>
</tr>
</thead>
<tbody>
<tr>
<td>Bug report?</td>
<td>yes</td>
</tr>
<tr>
<td>Feature request?</td>
<td>no</td>
</tr>
<tr>
<td>BC Break report?</td>
<td>no</td>
</tr>
<tr>
<td>RFC?</td>
<td>no</td>
</tr>
<tr>
<td>Symfony version</td>
<td>3.2.13</td>
</tr>
</tbody>
</table>
<p dir="auto">I have implemented form field for collection with allow_delete = true, allow_add = true and by_reference = false options.</p>
<p dir="auto">I added needed js code to delete elements and append forms for new objects of this collection from prototype.</p>
<p dir="auto">This works as I expected, but when I submit a few subforms for this collection with indexes not in order (for example 0, 1, 3 instead of 0, 1, 2), then errors from subform with index 3 are assigned to index 2 (which not exists), but subforms are rendered with indexes 0, 1, 3 (same as before submit) after invalid form submit...</p>
<p dir="auto">I'm sure that it worked correctly in Symfony (errors from subform with index 3 are assigned to subform with same index).</p>