Custom comment form example doesn't show submit button
Django's comments framework: http://docs.djangoproject.com/en/dev/ref/contrib/comments/#rendering-a-custom-comment-form
The following snippet doesn't show the submit button:
{% get_comment_form for event as form %}
<form action="{% comment_form_target %}" method="POST">
{{ form }}
<p class="submit">
<input type="submit" name="preview" class="submit-post" value="Preview">
</p>
</form>
Should be something of the form:
{% get_comment_form for event as form %}
<form action="{% comment_form_target %}" method="POST">
{{ form }}
<tr>
<td></td>
<td><input type="submit" name="preview" class="submit-post" value="Preview"></td>
</tr>
</form>
Change History
(7)
milestone: |
→ 1.1
|
Triage Stage: |
Unreviewed → Accepted
|
Triage Stage: |
Accepted → Ready for checkin
|
Has patch: |
set
|
Patch needs improvement: |
set
|
Triage Stage: |
Ready for checkin → Accepted
|
Keywords: |
kkmegapatch added
|
Owner: |
changed from nobody to Kevin Kubasik
|
Resolution: |
→ fixed
|
Status: |
new → closed
|
How about if we fix the whole problem? The form, as given in the docs, is pretty broken. It claims to be an entire form, but spits out HTML tr and td elements without putting them inside a table. That's why the problem occurs. It's probably not a bad idea to put the submit button in a "p" element, for easier styling. The trick is to remember to close the table element first. Which means we should probably open it as well. (The other motivation for using a paragraph element there is to provide a subtle lead that they're not always required to only use table elements or only use list elements or whatever: they can use the appropriate HTML element in the appropriate place.)
Even if we go end up going with putting the submit button into the table, we should include the table elements