I have code written completely in django using get/post method. After submitting the button, it reloads the page. How can I stop reloading the page whenever we are submitting a form?
Asked
Active
Viewed 1,774 times
0
-
3With an AJAX call. – Willem Van Onsem Jun 08 '18 at 09:34
-
but like for that entire code should be changed? – Ishmanpreet Singh Jun 08 '18 at 09:36
-
Duplicate? [Submit but not reload](https://stackoverflow.com/questions/14966985/django-save-data-on-submit-but-not-reload-view) – dome12b Jun 08 '18 at 09:36
-
till now whenever i am clicking the submit it goes to the post method.Does all the necessary changes and then after the reload the new items gets reloaded.Now I want the same thing but only the new page should not reload. – Ishmanpreet Singh Jun 08 '18 at 09:42
-
This is advisable, since rendering content with `POST` could result in a reload problem: https://en.wikipedia.org/wiki/Post/Redirect/Get – Willem Van Onsem Jun 08 '18 at 10:01
1 Answers
1
I think you should try to submit form with AJAX. To stop reloading the page you should have to use ajax. you can follow the link this may solve your problem Click Here

Parth Modi
- 291
- 1
- 5