Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8878383
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T19:41:56+00:00 2026-06-14T19:41:56+00:00

I am using inline formsets. I have a main form application . Then 2

  • 0

I am using inline formsets. I have a main form application. Then 2 formsets employ and qual.

When I run my view. I get an error saying ManagementForm data is missing or has been tampered with

Here is my view

@login_required
def apply(request):
    if request.POST:
        data = {'form-TOTAL_FORMS': u'1','form-INITIAL_FORMS': u'0','form-MAX_NUM_FORMS': u''}
        form = ApplicationForm(request.POST)
        employ_formset = EmploymentFormSet(data)
        qual_formset = QualificationFormSet(data)
        if form.is_valid():
            application = form.save(commit=False)
            employ_formset = EmploymentFormSet(request.POST, instance=application)
            qual_formset = QualificationFormSet(request.POST, instance=application)
            if employ_formset.is_valid() and qual_formset.is_valid():
                application.save()
                employ_formset.save()
                qual_formset.save()
            return HttpResponse('This Worked!!!!!!!!')
    else:
        form = ApplicationForm()
        employ_formset = EmploymentFormSet(instance=Application())
        qual_formset = QualificationFormSet(instance=Application())
    return render_to_response('apply.html', {'form':form, 'employ_formset':employ_formset, 'qual_formse

And here is my template. I realise I could simply the template. But I want the inline formsets to appear horizontally like the Django Admin.

{% extends "base.html" %}
{% load i18n %}

{% block content %}
<form action="." method="post" class="application_form">
    {% csrf_token %}
    <!-- PERSONAL -->
    <h3>Applicant Details</h3><br />
    <table>
      <tr>
        <td><label for="id_title">Title:</label></td>
        <td>{{ form.title }}<small>{{ form.title.errors }}</small></td>
      </tr>
      <tr>
        <td><label for="id_firstname">Firstname:</label></td>
        <td>{{ form.firstname }}<small>{{ form.firstname.errors }}</small></td>
        <td><label for="id_surname">Surname:</label></td>
        <td>{{ form.surname }}<small>{{ form.surname.errors }}</small></td>
      </tr>
      <tr>
        <td><label for="id_address">Address:</label></td>
        <td>{{ form.address }}<small>{{ form.address.errors }}</small></td>
      </tr>
      <tr>
        <td><label for="id_email">Email:</label></td>
        <td>{{ form.email }}<small>{{ form.email.errors }}</small></td>
      </tr>
      <tr>
        <td><label for="id_mobilephone">Mobile Phone:</label></td>
        <td>{{ form.mobilephone }}<small>{{ form.mobilephone.errors }}</small></td>
      </tr>
      <tr>
        <td><label for="id_homephone">Home Phone:</label></td>
        <td>{{ form.homephone }}<small>{{ form.homephone.errors }}</small></td>
      </tr>
    </table>

    <!-- EDUCATION -->
    <br />
    <h3>Employment Details</h3><br />
    {{ employ_formset.management_form }}
    {{ employ_formset.non_form_errors.as_ul }}
    <table id="formset" class="form">
    {% for form in employ_formset.forms %}
      {% if forloop.first %}
      <thead>
        <tr>
        {% for field in form.visible_fields %}
          <th>{{ field.label|capfirst }}</th>
        {% endfor %}
        </tr>
      </thead>
      {% endif %}
      <tr class="{% cycle row1,row2 %}">
      {% for field in form.visible_fields %}
    <td>
    {# Include the hidden fields in the form #}
    {% if forloop.first %}
      {% for hidden in form.hidden_fields %}
        {{ hidden }}
      {% endfor %}
    {% endif %}
    {{ field.errors.as_ul }}
    {{ field }}
    </td>
  {% endfor %}
  </tr>
{% endfor %}
</table>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T19:41:57+00:00Added an answer on June 14, 2026 at 7:41 pm

    You don’t have to build the dict for management data as in your code:

    data = {'form-TOTAL_FORMS': u'1','form-INITIAL_FORMS': u'0','form-MAX_NUM_FORMS': u''}
    

    This should come from the POST. If you want you can change it appropriately using max_num, extra parameters while building the formset in processing GET request.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Django and have a form with two additional inline formsets. I want
I'm using a 3-tier architecture for my application. I'm using inline code to call
I'm using an inline function to submit a form but it's not calling the
Using HTML and CSS. I have text surrounded by a border using display:inline to
I'm trying to get YUIs DataTable to work using Inline Cell Editing that can
I am trying to put in a log-in form via a lightbox using inline
I have been studying the modalforms & inline formsets but am not able to
I have a function using inline assembly: vec8w x86_sse_ldvwu(const vec8w* m) { vec8w rd;
I am using inline assembly in Visual C++ and have been trying for days
I am using inline haml templates in my sinatra app. I have a @@layout

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.