mirror of https://github.com/django/django.git
Fixed #5053 -- Added 'action' attribute to <form> tags that didn't have that attribute in docs/newforms.txt examples. Perfectionism appreciated, trickyb
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5813 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
89977a6e16
commit
9a090b2c1f
|
@ -641,7 +641,7 @@ the "Outputting forms as HTML" section above.
|
||||||
The simplest way to display a form's HTML is to use the variable on its own,
|
The simplest way to display a form's HTML is to use the variable on its own,
|
||||||
like this::
|
like this::
|
||||||
|
|
||||||
<form method="post">
|
<form method="post" action="">
|
||||||
<table>{{ form }}</table>
|
<table>{{ form }}</table>
|
||||||
<input type="submit" />
|
<input type="submit" />
|
||||||
</form>
|
</form>
|
||||||
|
@ -653,7 +653,7 @@ class' ``__str__()`` method calls its ``as_table()`` method.
|
||||||
|
|
||||||
The following is equivalent but a bit more explicit::
|
The following is equivalent but a bit more explicit::
|
||||||
|
|
||||||
<form method="post">
|
<form method="post" action="">
|
||||||
<table>{{ form.as_table }}</table>
|
<table>{{ form.as_table }}</table>
|
||||||
<input type="submit" />
|
<input type="submit" />
|
||||||
</form>
|
</form>
|
||||||
|
@ -675,7 +675,7 @@ individual fields for complete template control over the form's design.
|
||||||
The easiest way is to iterate over the form's fields, with
|
The easiest way is to iterate over the form's fields, with
|
||||||
``{% for field in form %}``. For example::
|
``{% for field in form %}``. For example::
|
||||||
|
|
||||||
<form method="post">
|
<form method="post" action="">
|
||||||
<dl>
|
<dl>
|
||||||
{% for field in form %}
|
{% for field in form %}
|
||||||
<dt>{{ field.label }}</dt>
|
<dt>{{ field.label }}</dt>
|
||||||
|
@ -696,7 +696,7 @@ Alternatively, you can arrange the form's fields explicitly, by name. Do that
|
||||||
by accessing ``{{ form.fieldname }}``, where ``fieldname`` is the field's name.
|
by accessing ``{{ form.fieldname }}``, where ``fieldname`` is the field's name.
|
||||||
For example::
|
For example::
|
||||||
|
|
||||||
<form method="post">
|
<form method="post" action="">
|
||||||
<ul class="myformclass">
|
<ul class="myformclass">
|
||||||
<li>{{ form.sender.label }} {{ form.sender }}</li>
|
<li>{{ form.sender.label }} {{ form.sender }}</li>
|
||||||
<li class="helptext">{{ form.sender.help_text }}</li>
|
<li class="helptext">{{ form.sender.help_text }}</li>
|
||||||
|
|
Loading…
Reference in New Issue