Submit button is not working in html using django

Question:

HTML FILE

in html page action is not added i wanted to know how i can submit the form without adding action attribute??

Asked By: ganesh

||

Answers:

simply add your submit in the form tag:

<form method="post">
   {% csrf_token %}
   {{form.as_p}}
   <input type="submit" value="submit" class="btn btn-primary"/>
</form>

and if you don’t want that, so use form= in submit:

<form method="post" id="this_form">
   {% csrf_token %}
   {{form.as_p}}
 </form>
<input type="submit" form="this_form" value="submit" class="btn btn-primary"/>
Answered By: Saeed Ramezani