-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Closed
Labels
Description
Errors are not associated with the field when the indices has a gap.
The errors are displayed for both fields.
<input type="text" id="post_photos_0_fileName" name="post[photos][0][fileName]" value="" />
<input type="text" id="post_photos_1_fileName" name="post[photos][1][fileName]" value="" />
Errors are only displayed for the first field.
<input type="text" id="post_photos_0_fileName" name="post[photos][0][fileName]" value="" />
<input type="text" id="post_photos_2_fileName" name="post[photos][2][fileName]" value="" />
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->add(
'photos',
'collection',
array(
'type' => new PhotoType(),
'allow_add' => true,
'allow_delete' => true,
'prototype' => true,
'by_reference' => false
)
);
}