title: Getting id of the form in formset which is being edited
body: <p>I have a Django template that renders a table comprising Django formsets.</p>
  
  <p>Template (<em>simplified</em>)</p>
  
  <pre><code>&lt;table id = 'my_table'&gt;
     {% for form in my_formset %}
         &lt;tr&gt;&lt;td&gt;{{form.my_field}}&lt;/td&gt;&lt;/tr&gt;
     {% endfor %}
  &lt;/table&gt;
  </code></pre>
  
  <p>Now, I have a Jquery code which looks something like this:</p>
  
  <pre><code>$(document).on('change', '#my_table tr input[type = text], input[type = number]', function(){
          // currently the following code handles save event
          // $.post ('/save_my_form/', $form.serialize()) 
      });
  </code></pre>
  
  <p>And the corresponding Django view</p>
  
  <pre><code>def save_my_form(request):
      # .......
      for form in order_draft_formset:
          if form.is_valid():
             form.save()
      # .......
  </code></pre>
  
  <p>The problem with this approach is that I modify only one single input element in one single form, whereas the Django view loops through entire formset. The question is, is there any built-in Django way to fetch the form within which the modified input is localized, so that I save only this exact form in my view without going through the entire formset. I feel that Jquery must somehow submit some info via post-request parameters that would help Django do that. As for now, I am thinking of parsing the automatically Django-generated id, f.e, id_form-5-my_field, and getting "5" out of it in Jquery and passing this "5" to Django. But I have a terrible feeling that this is a "dirty" method, and there must be a cleaner way to do that. Any ideas on this ?</p>