I do it like this
create a form template (for abbreviation I will use {{form}}
form_template.html
> {{form}}
>
in include form_template.html public_contact.html
>
>
>
{% include 'form_template.html' %}
>
>
and in the ajax response
from django.template.loader import render_to_string
I have a contact form through which users would be able to contact me. I am
using django with ajax, and it works fine *if* there's no error. I would
like to show the errors if there's any like it displays above the input
fields and not just the errors, but both the input and the errors. It does
2 matches
Mail list logo