Reputation: 579
I would like to show an image when a user clicks a submit button.
I want to just change the image, not render the whole page.
What is the best way to do this?
Upvotes: 1
Views: 1430
Reputation: 134
Have the images loaded to the page AJAX. Use Django template and tags to form the logic for a submission.
{% if form submission %}
{% if lion %}
{% include '<img>' %}
{% elif dog %}
........
Upvotes: 3