Skip to content

Commit aa075e9

Browse files
committed
minor #14761 Shortening the text some more (ThomasLandauer)
This PR was merged into the 4.4 branch. Discussion ---------- Shortening the text some more As a separate PR, as recommended by #13450 (comment) * Reason for deleting "Add a script tag somewhere on your page...": Lenghthy text that didn't say much ;-) * Reason for deleting the `note`: The JavaScript code is shown in itself; not inside some HTML ;-) Commits ------- dc794b9 Shortening the text some more
2 parents ec51ca9 + dc794b9 commit aa075e9

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

form/form_collections.rst

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ the following ``data-prototype`` attribute to the existing ``<ul>`` in your temp
245245

246246
<ul class="tags" data-prototype="{{ form_widget(form.tags.vars.prototype)|e('html_attr') }}"></ul>
247247

248-
Now add a button just next to the ``<ul>`` to dynamically add a new tag
248+
Now add a button just next to the ``<ul>`` to dynamically add a new tag:
249249

250250
.. code-block:: html+twig
251251

@@ -285,9 +285,7 @@ and dynamically add new tag forms when the user clicks the "Add a tag" link.
285285
This example uses `jQuery`_ and assumes you have it included somewhere on your
286286
page (e.g. using Symfony's :doc:`Webpack Encore </frontend>`).
287287

288-
Add a ``script`` tag somewhere on your page so you can start writing some
289-
JavaScript. In this script, bind to the "click" event of the "Add a tag"
290-
button so you can add a new tag form (``addFormToCollection()`` will be show next):
288+
Now add the required functionality with JavaScript:
291289

292290
.. code-block:: javascript
293291
@@ -345,11 +343,6 @@ one example:
345343
$collectionHolder.append($newFormLi)
346344
}
347345
348-
.. note::
349-
350-
It is better to separate your JavaScript in real JavaScript files than
351-
to write it inside the HTML as is done here.
352-
353346
Now, each time a user clicks the ``Add a tag`` link, a new sub form will
354347
appear on the page. When the form is submitted, any new tag forms will be converted
355348
into new ``Tag`` objects and added to the ``tags`` property of the ``Task`` object.

0 commit comments

Comments
 (0)