Asif
Asif

Reputation: 1825

request.POST on multiple image buttons in django

I have django form which consist of two image buttons. Now how can i perform two different POST action based on specific image button clicked in views.py?

I followed the below link

How can I build multiple submit buttons django form?

The above link will use name property of input tag and performs the action.

But this link will only describes about submit buttons but not about image buttons

Any solutions?

Thanks in advance

Upvotes: 0

Views: 1112

Answers (1)

Jingo
Jingo

Reputation: 3240

Image buttons work same as "normal" buttons. Just assign a name attribute as you would do with input type button.

The link you provide describes what to do.

Upvotes: 1

Related Questions