A
A
Andrey2018-10-06 23:34:06
Django
Andrey, 2018-10-06 23:34:06

How to display multiple buttons with different actions?

There is a form in jung, how to display several buttons with different actions on it?
For example, I do this

<form action = "{% url '_doc1' %}" method="POST">
<input type="submit" class = 'btn btn-success' value="Сохранить данные">

and
<form action = "{% url '_doc2' %}" method="POST">
<input type="submit" class = 'btn btn-success' value="Сохранить данные">

The data on the form is the same, but on pressing different buttons - different actions.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
SwoDs, 2018-10-07
@alexsandrinia

It seems to me that the problem here is not how to assign a different action to the buttons, but the problem is in the implementation itself, maybe you should just leave 1 action, and name the buttons differently? This will be a smarter decision
. When the data arrives, use the button to determine which script / method / function to use

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question