B
B
blazer052018-03-12 21:04:03
Django
blazer05, 2018-03-12 21:04:03

Feedback form not working?

Hello.
I do not understand where the cant in the template? I render the form into the variable template {{ form }} and everything works. But if I display the code of the form name="subject" directly in html, it doesn't work, the page is stupidly reloaded and that's it.
here is the code how it works.

<form action="{% url 'contact:contactform' %}" method="post">
                    {% csrf_token %}
                     {{ form.as_p }}
                    <div class="form-group">
                    </div>
<button type="submit" class="btn btn-warning">Отправить</button>
               </form>

and that doesn't work.
<form action="{% url 'contact:contactform' %}" method="post">
                    {% csrf_token %}
                    <div class="form-group">
                        <input id="id_name" type="text" name="name" class="form-control" placeholder="ФИО"/>
                    </div>
<button type="submit" class="btn btn-warning">Отправить</button>
                </form>

what's the bug?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
Jabrail Gadzhimuradov, 2018-03-13
@djabrailru

try
or
{{ form.name }} location input

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question