title: jQuery serializeArray() JSON String
body: <p>I am  trying to serializeArray my form submission in jQuery. I am trying to get a JSON like
  String or Object. Also if someone can let me know how to pick only those widgets which have a value rather than empty ones that would be perfect. </p>
  
  <p>I was in a hurry hence didnt check the syntax and I apologize for it.</p>
  
  <pre><code>   &lt;html&gt;
      &lt;head&gt;
      &lt;script type="text/javascript"&gt;
  
      $(document.ready(function(){
         $("#myform").submit(function(){
  
             var mySerialObj = $("#myform").serializeArray();
  
              $.each(mySerialObj,function(indx,idxVal){
                   //here indx is numeric and idxVal is a String like
                   // [{{"name","name"},{"value","RED"}}]
  
                       $.each(JSON.parse(idxVal),function(i,v){
  
                             //here I am not able to get the thinggy into a 
                             //  JSON format something like ['name','RED'] 
                          });
  });
  
  });
  
  
  });   
  
  
      &lt;/script&gt;
      &lt;/head&gt;
      &lt;body&gt;
  
      &lt;form id="myform"&gt;
      &lt;div&gt;
      &lt;span&gt;What color do you prefer?&lt;/span&gt;&lt;br /&gt;
      &lt;input type="radio" name="colors" id="red" /&gt;Red&lt;br /&gt;
      &lt;input type="radio" name="colors" id="blue" /&gt;Blue&lt;br /&gt;
      &lt;input type="radio" name="colors" id="green" /&gt;Green
      &lt;/div&gt;
  
      &lt;div&gt; 
      &lt;select&gt;
        &lt;option value="volvo"&gt;Volvo&lt;/option&gt;
        &lt;option value="saab"&gt;Saab&lt;/option&gt;
        &lt;option value="mercedes"&gt;Mercedes&lt;/option&gt;
        &lt;option value="audi"&gt;Audi&lt;/option&gt;
      &lt;/select&gt;
      &lt;/div&gt;
  
      &lt;/form&gt;
  
      &lt;button type="submit" value="submit" id="sbmt""&gt;submit&lt;/button&gt;
  
  
      &lt;/body&gt;
      &lt;/html&gt;
  </code></pre>