8000 Merge branch '5.0' · symfony/symfony-docs@326eff4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 326eff4

Browse files
committed
Merge branch '5.0'
* 5.0: Shortening the "Prototype" paragraph
2 parents dde5300 + 24bd0cd commit 326eff4

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

form/form_collections.rst

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -211,16 +211,14 @@ yet to add new tags or delete existing ones.
211211
Allowing "new" Tags with the "Prototype"
212212
----------------------------------------
213213

214-
Allowing the user to dynamically add new tags means that you'll need to
215-
use some JavaScript. Previously you added two tags to your form in the controller.
216-
Now let the user add as many tag forms as they need directly in the browser.
217-
This will be done through a bit of JavaScript.
218-
219-
The first thing you need to do is to let the form collection know that it will
220-
receive an unknown number of tags. So far you've added two tags and the form
221-
type expects to receive exactly two, otherwise an error will be thrown:
222-
``This form should not contain extra fields``. To make this flexible,
223-
add the ``allow_add`` option to your collection field::
214+
Previously you added two tags to your task in the controller. Now let the users
215+
add as many tag forms as they need directly in the browser. This requires a bit
216+
of JavaScript code.
217+
218+
But first, you need to let the form collection know that instead of exactly two,
219+
it will receive an *unknown* number of tags. Otherwise, you'll see a
220+
*"This form should not contain extra fields"* error. This is done with the
221+
``allow_add`` option::
224222

225223
// src/Form/TaskType.php
226224

0 commit comments

Comments
 (0)
0