Skip to content
Browse files

[1.5.x] Fixed #21223 -- Added form.id_for_label to topic guide.

Thanks ebertti at for the suggestion.

Backport of 018e2c0 from master
  • Loading branch information...
1 parent 7f62d79 commit 6e7de2edb0565e0ea2fd4ff6701e97ead67138b9 @saoili saoili committed with timgraham
Showing with 6 additions and 0 deletions.
  1. +6 −0 docs/topics/forms/index.txt
6 docs/topics/forms/index.txt
@@ -319,6 +319,12 @@ attributes, which can be useful in your templates:
The field's label wrapped in the appropriate HTML ``<label>`` tag,
e.g. ``<label for="id_email">Email address</label>``
+``{{ field.id_for_label }}``
+ The ID that will be used for this field (``id_email`` in the example
+ above). You may want to use this in lieu of ``label_tag`` if you are
+ constructing the label manually. It's also useful, for example, if you have
+ some inline JavaScript and want to avoid hardcoding the field's ID.
``{{ field.value }}``
The value of the field. e.g ````

0 comments on commit 6e7de2e

Please sign in to comment.
Something went wrong with that request. Please try again.