summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSorcha Bowler <saoili@gmail.com>2013-10-14 21:16:49 +0100
committerTim Graham <timograham@gmail.com>2013-10-14 18:43:48 -0400
commit6e7de2edb0565e0ea2fd4ff6701e97ead67138b9 (patch)
tree685eb674ffbe33ec926f7374aa73a260c4226283
parent7f62d794b303bedfd094742a84dcc8b85df3ba8b (diff)
[1.5.x] Fixed #21223 -- Added form.id_for_label to topic guide.
Thanks ebertti at yahoo.com.br for the suggestion. Backport of 018e2c055a from master
-rw-r--r--docs/topics/forms/index.txt6
1 files changed, 6 insertions, 0 deletions
diff --git a/docs/topics/forms/index.txt b/docs/topics/forms/index.txt
index 4035fbd9cc..3fb17cfdf0 100644
--- a/docs/topics/forms/index.txt
+++ b/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 ``someone@example.com``