Skip to content

Commit dc794b9

Browse files
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 ;-) *
1 parent c497b6c commit dc794b9

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

form/form_collections.rst

+2-9
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

@@ -284,9 +284,7 @@ The goal of this section will be to use JavaScript to read this attribute
284284
and dynamically add new tag forms when the user clicks the "Add a tag" button.
285285
This example uses jQuery and assumes you have it included somewhere on your page.
286286

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

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

0 commit comments

Comments
 (0)