[Answer]-Why is this django formset not being submitted?

1👍

Your submit button is not within the form, so the action is not triggered by the click!

Here’s how the docs show you to render formsets:

<form method="post" action="">
    <!-- Notice how the formset (below) and thus its submit button
         is INSIDE the form (above) -->
    {{ formset.management_form }}
    <table>
        {% for form in formset %}
        {{ form }}
        {% endfor %}
    </table>
</form>

You try to create multiple forms with the form.prefix for id. This could work but each form would have to be rendered with its own submit button. Formsets are designed to combine multiple forms into one and guarantee uniqueness of value names by said prefix. They would be enclosed in a singe form and share any submit triggers.

Leave a comment