Skip to content

Multiple submit buttons in modal #205

@valentinpatrascu

Description

@valentinpatrascu

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Q&AQuestions and answers

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions