0

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

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

1 Comment

if i add <input type="submit" name="add_skill" value="Add Skill" /> this will work. But if i add below mentioned image button then form will not POST. <input type="image" src="/site_media/img/icons/add_image.gif" name="add_skill" value="Add Skill" /> What is the difference between above two tags?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.