title: django getlist() from ajax html form
body: <p>Im trying to send my serialized form data to django where it will should be stored in "mylist" as a list "[video, audio]". views.py return 0 everytime no matter what boxes I check on my form.</p>
  
  <p>html form</p>
  
  <pre><code>&lt;form id="myform" method="POST"&gt;
  &lt;input type="checkbox" name="list" value="audio"/&gt; Audio&lt;br /&gt;
  &lt;input type="checkbox" name="list" value="video"/&gt; Video&lt;br /&gt;
  &lt;input type="submit" value="Get Custom Library!" /&gt; 
  &lt;/form&gt;
  </code></pre>
  
  <p>jquery ajax</p>
  
  <pre><code>&lt;script language="JavaScript"&gt;
  $(document).ready(function() {
  $("#myform").submit(function() {
  
          $.ajax({
          type: "POST",
          url: 'django/builder/buildit',
          data: $(this).serialize(),
          success: function(response){
              alert(response);
          }
      });
      return false;
  });
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>views.py</p>
  
  <pre><code>from django.http import HttpResponse
  def main(request):
    mylist = request.POST.getlist('list')
    message = 0
    for item in mylist:
      if item == 'video':
        message = 'vid'
      elif item == 'audio':
        message = 'aud'
    return HttpResponse(message)
  </code></pre>