title: jQuery Post data not working
body: <p>I am trying to post the values of checked boxes, but unable to do so. It first collects all the checked boxes in an array (<code>datas</code>-which is working fine upon testing it with <code>console.log(datas)</code>) and then sends them collectively. But I'm not able to post the data. I'm getting an empty array. Where I'm going wrong? </p>
  
  <p><strong>views.py</strong></p>
  
  <pre><code>if request.method == 'POST':
      selected_users = request.POST.getlist('users[]')
      return HttpResponse(selected_users)
  </code></pre>
  
  <p><strong>jQuery</strong></p>
  
  <pre><code>$(document).ready(function(){
      $('#submit').click(function() {
          var datas = new Array();
          var i = 0;
  
          $("input[type=checkbox]:checked").each(function() {
              datas[i] = $(this).val();
              i++;
          });   
  
          console.log(datas)   //works fine
          $.post("get_data/", {'users[]': datas}, function(data){
              alert(data);
          });   
      });    
  })
  </code></pre>
  
  <p><strong>urls.py</strong></p>
  
  <pre><code>urlpatterns = patterns('',
      url(r'get_data/','apps.api.views.get_data', name = 'grabhalo_get_data'),
  )
  </code></pre>
  
  <p><strong>Checkboxes</strong></p>
  
  <pre><code>{% for user in users %}
      &lt;input type="checkbox" class="check" value="{{user.id}}" /&gt;{{user.name}}&lt;br&gt;    
  {%endfor%}
  
      &lt;form id="form" method="POST" action="#"&gt;
         {% csrf_token %}
         &lt;input type="text" class="span8 search-query" placeholder="Type here..." name="chat"&gt;
         &lt;input type="submit" value="Send" class = "btn btn-primary" id = "submit"&gt;
     &lt;/form&gt;
  </code></pre>
  
  <p>Here are the parameters while viewing <strong>console.log</strong></p>
  
  <pre><code>users[] 1
  users[] 2
  </code></pre>
  
  <p>I'm guess there is some bug in views.py, though not sure. Kindly help me rectify the same.</p>