I have a web page where the user enters some data and then clicks a submit button. I process the data and then use the same Django template to display the original data, the submit button, and the results. When I am using the Django template to display results, I would like the page to be automatically scrolled down to the part of the page where the results begin. This allows the user to scroll back up the page if she wants to change her original data and click submit again. Hopefully, there’s some simple way of doing this that I can’t see at the moment.
Share
It should already work if you provide a fragment identifier in the action method of the form:
and somewhere below the form, where you want to show the results:
This should make the page jump to the
<div>with IDresults.It is complete client site and does not involve Django, JavaScript or similar.