[1.6.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
This commit is contained in:
Sorcha Bowler 2013-10-14 21:16:49 +01:00 committed by Tim Graham
parent ba9cf9596b
commit 07ebd23254
1 changed files with 6 additions and 0 deletions

View File

@ -325,6 +325,12 @@ attributes, which can be useful in your templates:
<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``