Skip to content

Commit 27acec3

Browse files
Moving the "On the rendered page" paragraph upwards
Nothing changed in the code.
1 parent 95f5cc1 commit 27acec3

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

form/form_collections.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,12 @@ new "tag" forms. To render it, make the following change to your template:
280280
...
281281
</ul>
282282

283+
On the rendered page, the result will look something like this:
284+
285+
.. code-block:: html
286+
287+
<ul class="tags" data-prototype="&lt;div&gt;&lt;label class=&quot; required&quot;&gt;__name__&lt;/label&gt;&lt;div id=&quot;task_tags___name__&quot;&gt;&lt;div&gt;&lt;label for=&quot;task_tags___name___name&quot; class=&quot; required&quot;&gt;Name&lt;/label&gt;&lt;input type=&quot;text&quot; id=&quot;task_tags___name___name&quot; name=&quot;task[tags][__name__][name]&quot; required=&quot;required&quot; maxlength=&quot;255&quot; /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;">
288+
283289
.. note::
284290

285291
If you render your whole "tags" sub-form at once (e.g. ``form_row(form.tags)``),
@@ -298,12 +304,6 @@ new "tag" forms. To render it, make the following change to your template:
298304
299305
{{ form_widget(form.tags.vars.prototype.name)|e }}
300306
301-
On the rendered page, the result will look something like this:
302-
303-
.. code-block:: html
304-
305-
<ul class="tags" data-prototype="&lt;div&gt;&lt;label class=&quot; required&quot;&gt;__name__&lt;/label&gt;&lt;div id=&quot;task_tags___name__&quot;&gt;&lt;div&gt;&lt;label for=&quot;task_tags___name___name&quot; class=&quot; required&quot;&gt;Name&lt;/label&gt;&lt;input type=&quot;text&quot; id=&quot;task_tags___name___name&quot; name=&quot;task[tags][__name__][name]&quot; required=&quot;required&quot; maxlength=&quot;255&quot; /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;">
306-
307307
The goal of this section will be to use JavaScript to read this attribute
308308
and dynamically add new tag forms when the user clicks a "Add a tag" link.
309309
To make things simple, this example uses jQuery and assumes you have it included

0 commit comments

Comments
 (0)