- 1

Django - loop: which button clicked?

I put a list on my html {% for L in List %} {{L.name}} {{L.price}} ... And then a button/form like: <form name={{L.id}} action="myDef"> / <input name ={{L.id}} > / <button name = {{L.id}} > {% endfor In my views, I would like to get the button/form name/value, whatever helps, to check which button was clicked. Can you give me a hint?

16th Jan 2021, 4:15 PM
Fu Foy
Fu Foy - avatar
1 Odpowiedź
0
Omg simple. I used a hidden input. Got the value by the name...
16th Jan 2021, 10:51 PM
Fu Foy
Fu Foy - avatar