diff options
| author | Adrian Holovaty <adrian@holovaty.com> | 2007-12-01 19:31:53 +0000 |
|---|---|---|
| committer | Adrian Holovaty <adrian@holovaty.com> | 2007-12-01 19:31:53 +0000 |
| commit | 0e464d5d5c354883134f739a5511e688a5cb1ec5 (patch) | |
| tree | 4f8a870527616a99a8cbd09e462f4185f4bbdd48 /docs | |
| parent | 5e06c129c6c4e615c6ef10b930aa825ce978adb7 (diff) | |
Edited docs/newforms.txt changes from [6740]
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6803 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/newforms.txt | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/docs/newforms.txt b/docs/newforms.txt index 737d431ccb..6635063e3c 100644 --- a/docs/newforms.txt +++ b/docs/newforms.txt @@ -756,8 +756,9 @@ For example:: Highlighting required fields in templates ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -You may wish to show a visitor which fields are required. Here is the above -example modified to insert an asterix after the label of each required field:: +It's common to show a user which fields are required. Here's an example of how +to do that, using the above example modified to insert an asterisk after the +label of each required field:: <form method="post" action=""> <dl> @@ -772,10 +773,11 @@ example modified to insert an asterix after the label of each required field:: </form> The ``{% if field.field.required %}*{% endif %}`` fragment is the relevant -addition here. It adds the asterix only if the field is required. Note that we -check ``field.field.required`` and not ``field.required``. In the template, -``field`` is a ``newforms.forms.BoundField`` instance, which holds the actual -``Field`` instance in its ``field`` attribute. +addition here. It adds the asterisk only if the field is required. + +Note that we check ``field.field.required`` and not ``field.required``. In the +template, ``field`` is a ``newforms.forms.BoundField`` instance, which holds +the actual ``Field`` instance in its ``field`` attribute. Binding uploaded files to a form -------------------------------- |
