django-bootstrap-modal-forms
django-bootstrap-modal-forms copied to clipboard
Multiple submit buttons in modal
trafficstars
Hello,
I have this issue that I cannot submit the form via multiple buttons in bootstrap modal. Check out the code below.
{% for payslip in payslips %}
<div class="modal-block-body">
<span>{{payslip.payslip_file}}</span>
<span>{{payslip.payslip_month}}</span>
<span>
<a href="#">Check it</a>
<button class="btn btn btn-link" type="submit" name="delete" value="{{payslip.pk}}">Delete payslip</button>
</span>
</div>
{% endfor %}
My idea was to use different values for each of the loop objects' buttons. But when I submit the form, the only field present in the POST request body is the csrfmiddlewaretoken. I tried to use other types of inputs, like <input type="text"> and that information is POSTed, but the info about the button pressed is not.
Are there any things that I'm missing or do you have any ideas on how to overcome this problem?