BingbongKim
BingbongKim

Reputation: 579

Django - show an image when a submit button is clicked

enter image description here

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

Answers (2)

noes1s
noes1s

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

Chandan Venkatesh
Chandan Venkatesh

Reputation: 114

you can use <iframe> from html5 to achieve your goal.

example

Upvotes: 0

Related Questions