title: django ModelForm: the form in the html cannot enter data and submit
body: <p>I created a Model Form, but in the page, it can only display the form, but cannot enter the data and no response after clicking the "submit" button. Is there anything wrong in my views or template?</p>
  
  <p>There iis no error alert when I open the page.</p>
  
  <p>Thanks for your help.</p>
  
  <p><strong>views.py</strong></p>
  
  <pre><code>from django.http import JsonResponse
  
  class ResultView(ListView):
      context_object_name = 'result_list'
      template_name = 'result_list.html'
  
       # /URL-to-ajax-view/
      def ajax_get_queryset(request):
          if self.request.method == 'POST' and request.is_ajax:
  
              form = InputForm(self.request.POST or None)
              if form.is_valid():
                  company = form.cleaned_data['company']
                  region = form.cleaned_data['region']
  
                  queryset=Result.objects.filter(company=company,region=region)
                  sales=Result.objects.queryset.aggregate(Sum('sales'))
  
              return render(request, 'dupont', {'sales': sales,'region':region,'queryset': queryset})
      else:
          form=InputForm()
  </code></pre>
  
  <p><strong>result_list.html</strong></p>
  
  <pre><code>&lt;style type="text/css"&gt;
  
  .basicinfo {
  position: absolute;
  width: 200px;
  height: 115px;
  left: 22px;
  top: 0px;   
  }
  
  &lt;body&gt;
  &lt;div class="basicinfo"&gt;
  &lt;form id="InputForm" method="post" action=""&gt;   #here is the data entry form
          {% csrf_token %}
  
          &lt;!--enter the company name--&gt; 
          &lt;div class="field"&gt;
              {{ form.company.errors }}
              &lt;label id="id_company" name="company" for="{{ form.company.id_for_label }}"&gt;Company:&lt;/label&gt;
              {{ form.company }}
          &lt;/div&gt;
  
          &lt;!--select region--&gt;
          &lt;div class="field" &gt;
              &lt;label&gt; Select the Region:
              {{ form.region }}
                  {% for region in form.region.choices %}
                       &lt;option value="region" name= "region" id="id_region"&gt;{{region}} &lt;/option&gt;
                  {% endfor %}
              &lt;/label&gt;
          &lt;/div&gt;
  
          &lt;!--submit--&gt;
          &lt;p&gt;&lt;input type="submit" value="Submit" /&gt;&lt;/p&gt;&lt;/div&gt;
      &lt;/form&gt; 
      &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;script src="http://apps.bdimg.com/libs/jquery/1.11.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.js"&gt;&lt;/script&gt;
  &lt;script src="http://malsup.github.com/jquery.form.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;
  
  $(document).ready(function() {
      $("#InputForm").submit(function() { // catch the form's submit event
      var region= $("#id_region").val();
      var company= $("#id_company").val();
  
          $.ajax({ // create an AJAX call...
              data: $(this).serialize(), // get the form data
              type: $(this).attr('post'),
              url: "dupont_list/",
              success: function(data) { // on success..
                  $("#result").html(data); // update the DIV "result"
              }
          });
          return false;
      });
  });
  &lt;/script&gt;
  
  
      &lt;div id="result" class="result"&gt;   &lt;!--Showing the filtered result in database--&gt;
  
      &lt;table&gt;
      &lt;tr&gt;&lt;b&gt;Sales&lt;/b&gt;&lt;/tr&gt;
      &lt;td&gt; {{sales.sales__sum}}&lt;/td&gt;
  
  
      &lt;tr&gt;&lt;b&gt;Employee&lt;/b&gt;&lt;/tr&gt;
      &lt;td&gt; {{employee.employee__sum}}&lt;/td&gt;
      &lt;/table&gt;
  </code></pre>