Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Submit button is not working in html using django

HTML FILE

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

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

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"/>
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading