Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Forms docs: More emphasis in 'id' value customizability.

  • Loading branch information...
commit 18ea1c473b3d314669f01e6ff347bdf8307bb941 1 parent 21c2bfd
Ramiro Morales authored October 12, 2013

Showing 1 changed file with 19 additions and 13 deletions. Show diff stats Hide diff stats

  1. 32  docs/ref/forms/api.txt
32  docs/ref/forms/api.txt
@@ -408,21 +408,27 @@ classes, as needed. The HTML will look something like::
408 408
 
409 409
 .. _ref-forms-api-configuring-label:
410 410
 
411  
-Configuring HTML ``<label>`` tags
412  
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  411
+Configuring form elements' HTML ``id`` attributes and ``<label>`` tags
  412
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  413
+
  414
+.. attribute:: Form.auto_id
  415
+
  416
+By default, the form rendering methods include:
  417
+
  418
+* HTML ``id`` attributes on the form elements.
413 419
 
414  
-An HTML ``<label>`` tag designates which label text is associated with which
415  
-form element. This small enhancement makes forms more usable and more accessible
416  
-to assistive devices. It's always a good idea to use ``<label>`` tags.
  420
+* The corresponding ``<label>`` tags around the labels. An HTML ``<label>`` tag
  421
+  designates which label text is associated with which form element. This small
  422
+  enhancement makes forms more usable and more accessible to assistive devices.
  423
+  It's always a good idea to use ``<label>`` tags.
417 424
 
418  
-By default, the form rendering methods include HTML ``id`` attributes on the
419  
-form elements and corresponding ``<label>`` tags around the labels. The ``id``
420  
-attribute values are generated by prepending ``id_`` to the form field names.
421  
-This behavior is configurable, though, if you want to change the ``id``
422  
-convention or remove HTML ``id`` attributes and ``<label>`` tags entirely.
  425
+The ``id`` attribute values are generated by prepending ``id_`` to the form
  426
+field names.  This behavior is configurable, though, if you want to change the
  427
+``id`` convention or remove HTML ``id`` attributes and ``<label>`` tags
  428
+entirely.
423 429
 
424  
-Use the ``auto_id`` argument to the ``Form`` constructor to control the label
425  
-and ``id`` behavior. This argument must be ``True``, ``False`` or a string.
  430
+Use the ``auto_id`` argument to the ``Form`` constructor to control the ``id``
  431
+and label behavior. This argument must be ``True``, ``False`` or a string.
426 432
 
427 433
 If ``auto_id`` is ``False``, then the form output will not include ``<label>``
428 434
 tags nor ``id`` attributes::
@@ -503,7 +509,7 @@ appended after any label name when a form is rendered.
503 509
     The default ``label_suffix`` is translatable.
504 510
 
505 511
 It's possible to customize that character, or omit it entirely, using the
506  
- ``label_suffix`` parameter::
  512
+``label_suffix`` parameter::
507 513
 
508 514
     >>> f = ContactForm(auto_id='id_for_%s', label_suffix='')
509 515
     >>> print(f.as_ul())

0 notes on commit 18ea1c4

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