Opened 17 years ago

Closed 17 years ago

#4353 closed (fixed)

Example error in newforms section "Using forms in views and templates"

Reported by: zendak Owned by: Jacob
Component: Documentation Version: dev
Severity: Keywords: newforms
Cc: Triage Stage: Ready for checkin
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The second example code in "Using forms in views and templates", subsection "Complex template output" contains semantic HTML errors. The closing "dd" tags within the "if" blocks should be closing "ul" tags.

<form method="post">
<ul class="myformclass">
    <li>{{ form.sender.label }} {{ form.sender.label }}</li>
    <li class="helptext">{{ form.sender.help_text }}</li>
    {% if form.sender.errors %}<ul class="errorlist">{{ form.sender.errors }}</dd>{% endif %}

    <li>{{ form.subject.label }} {{ form.subject.label }}</li>
    <li class="helptext">{{ form.subject.help_text }}</li>
    {% if form.subject.errors %}<ul class="errorlist">{{ form.subject.errors }}</dd>{% endif %}

    ...
</ul>
</form>

Correct:

...
    {% if form.sender.errors %}<ul class="errorlist">{{ form.sender.errors }}</ul>{% endif %}
...
    {% if form.subject.errors %}<ul class="errorlist">{{ form.subject.errors }}</ul>{% endif %}

Change History (2)

comment:1 by Gary Wilson <gary.wilson@…>, 17 years ago

Triage Stage: UnreviewedReady for checkin

comment:2 by Malcolm Tredinnick, 17 years ago

Resolution: fixed
Status: newclosed

(In [5352]) Fixed #4353 -- Fixed a typo in newforms documentation. I can't believe the
documentation editor didn't spot this. Thanks, zendak.

Note: See TracTickets for help on using tickets.
Back to Top