title: u'ManagementForm data is missing or has been tampered with' with Django formset
body: <p>I have three forms, depending on number of rooms i want to add or delete new fields "adult" and "children". For example: if value of field "room" will be 2, it should generate two couples another fields for each room 'adult' and 'children', but if change value from 2 on 1, it should delete one couple of fields. And when change the value of 'room' field from 2 to 3, it should add one couple of fields. </p>
  
  <p>My forms.py:</p>
  
  <pre><code>class HotelForm(forms.Form):
          rooms = forms.IntegerField(label=(u'Rooms'), min_value=1)
  
  class TouristsForm(forms.Form):
          adult = forms.IntegerField(label=(u'Adults'), min_value=1, initial=1)
          children = forms.IntegerField(label=(u'Children'), min_value=0, initial=0, required=False)
  
  class ChildrenAgeForm(forms.Form):
          children_age = forms.IntegerField(label=(u'Children age'), min_value=2, max_value=10, initial=2, required=False
  </code></pre>
  
  <p>That's how i realize formset and validation in views.py:</p>
  
  <pre><code>class BookingForm(View):
  
          template_name = 'booking/booking.html'
  
          def get(self, request, *args, **kwargs):
                  TouristsFormSet = formset_factory(TouristsForm, extra = 1, max_num = 15)
                  ChildrenAgeFormSet = formset_factory(ChildrenAgeForm, extra = 1, max_num = 20)
                  booking_form = HotelForm(prefix='booking_form')
                  tourists_formset = TouristsFormSet(prefix='tourists')
                  childrenage_formset = ChildrenAgeFormSet(prefix='childrenage')
                  return render(request, self.template_name, { 'booking_form' : booking_form, 'tourists_formset' : tourists_formset, 'childrenage_formset' : childrenage_formset })
  
  
          def post(self, request, *args, **kwargs):
                  TouristsFormSet = formset_factory(TouristsForm, extra = 1, max_num = 15)
                  ChildrenAgeFormSet = formset_factory(ChildrenAgeForm, extra = 1, max_num = 20)
                  booking_form = HotelForm(request.POST, prefix='booking_form')
                  tourists_formset = TouristsFormSet(request.POST, prefix='tourists')
                  childrenage_formset = ChildrenAgeFormSet(request.POST, prefix='childrenage')
                  if booking_form.is_valid() and tourists_formset.is_valid() and childrenage_formset.is_valid():
  </code></pre>
  
  <p>I add new formset fields in the form using java-script:</p>
  
  <pre><code>$(function(){
  
     $('#id_booking_form-rooms').on('change', function(e){
        var n = $('#id_booking_form-rooms').val() || 0;
        var html = "";
  
        for (var i = 0; i &lt; n; i++) {
           html += "&lt;div&gt;People in the room " + (i + 1) + "&lt;/div&gt;"
           + "&lt;br/&gt;&lt;label for='id_tourists-" + i + "-adult'&gt;Adults:&lt;/label&gt;"
           + "&lt;input id='id_tourists-" + i + "-adult' type='number' name='tourists-" + i + "-adult'/&gt;"
           + "&lt;label for='id_tourists-" + i + "-children'&gt;Children:&lt;/label&gt;"
           + "&lt;input id='id_tourists-" + i + "-children' type='number' name='tourists-" + i + "-children' class='children_age'/&gt;"
           + "&lt;div class='extrafieldWrapperChAge'&gt;&lt;/div&gt;";
         }
         $(".extrafieldWrapper").html(html);
      });
  
         $(".extrafieldWrapper").on('change', '.children_age', function(e){
  
            var n = $(this).val() || 0;
            var html = "";
  
            for (var i = 0; i &lt; n; i++) {
               html += "&lt;br/&gt;&lt;label for='id_childrenage-" + i + "-children_age'&gt;Children age "+(i+1)+"&lt;/label&gt;"
               + "&lt;input id='id_childrenage-" + i + "-children_age' type='number' name='childrenage-" + i + "children_age' /&gt;";
            }
            $(this).next('.extrafieldWrapperChAge').html(html);
       });
  
   });
  </code></pre>
  
  <p>There is how look like my template:</p>
  
  <pre><code>&lt;div class="row"&gt;
       &lt;div class="fieldWrapper"&gt;
            {% if booking_form.rooms.errors %}
                  &lt;ol style="list-style-type:square" &gt;
                        {% for error in booking_form.rooms.errors %}
                               &lt;li&gt;&lt;strong&gt;This field required&lt;/strong&gt;&lt;/li&gt;
                         {% endfor %}
                   &lt;/ol&gt;
             {% endif %}
             {{ booking_form.rooms.label_tag }}
             {{ booking_form.rooms }}
         &lt;/div&gt;
         &lt;div class="extrafieldWrapper"&gt;
             {{ tourists_formset.management_form }}
             {{ childrenage_formset.management_form }}
         &lt;/div&gt;
    &lt;/div&gt;
  </code></pre>
  
  <p>There is how look like my form in browser:</p>
  
  <pre><code>&lt;div class="fieldWrapper"&gt;
     &lt;label for="id_booking_form-rooms"&gt;Rooms:&lt;/label&gt;
     &lt;input id="id_booking_form-rooms" type="number" name="booking_form-rooms" min="1"&gt;
  &lt;/div&gt;
  &lt;div class="extrafieldWrapper"&gt;
     &lt;div&gt;People in the room 1&lt;/div&gt;
     &lt;br&gt;
     &lt;label for="id_tourists-0-adult"&gt;Adults:&lt;/label&gt;
     &lt;input id="id_tourists-0-adult" type="number" name="tourists-0-adult"&gt;
     &lt;label for="id_tourists-0-children"&gt;Children:&lt;/label&gt;
     &lt;input id="id_tourists-0-children" class="children_age" type="number" name="tourists-0-children"&gt;
     &lt;div class="extrafieldWrapperChAge"&gt;
        &lt;br&gt;
        &lt;label for="id_childrenage-0-children_age"&gt;Children age 1&lt;/label&gt;
        &lt;input id="id_childrenage-0-children_age" type="number" name="childrenage-0children_age"&gt;
     &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>But when i press submit button i always got <code>[u'ManagementForm data is missing or has been tampered with']</code>. What did i wrong? Thanks for your help</p>