title: change the value of name: in an object in serialize array
body: <p>I am doing this:</p>
  
  <pre><code>        var a_survey = $('#survey-1 :input').serializeArray();
  
          $.ajax({
              url: "/save_a_survey/",
              type: "post",
              data: a_survey,
              csrfmiddlewaretoken:'{{ csrf_token }}',
          });
  </code></pre>
  
  <p>Which passes this:</p>
  
  <pre><code>csrfmiddlewaretoken:6rS9oNMSJIzJw6ye8nCQZPRkjNemyMOD
  form-1-student:12
  form-1-behavior_type:Externalizer
  form-1-surveyset:13
  </code></pre>
  
  <p>But I want to change the names of the keys to:</p>
  
  <pre><code>csrfmiddlewaretoken:6rS9oNMSJIzJw6ye8nCQZPRkjNemyMOD
  student:12
  behavior_type:Externalizer
  surveyset:13
  </code></pre>
  
  <p>This probably seems like quite a hack, but I am dealing with django formsets and trying to save pieces of them at a time; Which may also sound like a hack...</p>
  
  <p>So far I have tried this:</p>
  
  <pre><code>    a_survey = $('#survey-1 :input').serializeArray();
      for (var i = 1; i &lt;= a_survey.length; i++) {
          a_survey[i]['name'] = a_survey[i]['name'].replace(/form-\d-/g, "");
      };
  </code></pre>
  
  <p>But I keep getting...</p>
  
  <pre><code>TypeError: Cannot read property 'name' of undefined
  </code></pre>
  
  <p>Thanks for the help</p>