Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple submit buttons in modal #205

Open
valentinpatrascu opened this issue Sep 26, 2022 · 0 comments
Open

Multiple submit buttons in modal #205

valentinpatrascu opened this issue Sep 26, 2022 · 0 comments
Labels
Q&A Questions and answers

Comments

@valentinpatrascu
Copy link

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?

@trco trco added the Q&A Questions and answers label Mar 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Q&A Questions and answers
Projects
None yet
Development

No branches or pull requests

2 participants