Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

Thanks ebertti at yahoo.com.br for the suggestion.

Backport of 018e2c0 from master
  • Loading branch information...
commit 6e7de2edb0565e0ea2fd4ff6701e97ead67138b9 1 parent 7f62d79
saoili authored October 14, 2013 timgraham committed October 14, 2013

Showing 1 changed file with 6 additions and 0 deletions. Show diff stats Hide diff stats

  1. 6  docs/topics/forms/index.txt
6  docs/topics/forms/index.txt
@@ -319,6 +319,12 @@ attributes, which can be useful in your templates:
319 319
     The field's label wrapped in the appropriate HTML ``<label>`` tag,
320 320
     e.g. ``<label for="id_email">Email address</label>``
321 321
 
  322
+``{{ field.id_for_label }}``
  323
+    The ID that will be used for this field (``id_email`` in the example
  324
+    above). You may want to use this in lieu of ``label_tag`` if you are
  325
+    constructing the label manually. It's also useful, for example, if you have
  326
+    some inline JavaScript and want to avoid hardcoding the field's ID.
  327
+
322 328
 ``{{ field.value }}``
323 329
     The value of the field. e.g ``someone@example.com``
324 330
 

0 notes on commit 6e7de2e

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