title: Jquery not serializing my radio buttons
body: <p>I can not get the result of the radio button and checkbox with jquery serialize()</p>
  
  <p>what is the problem?</p>
  
  <p>I put the code to see if you can help me, since all other elements process them correctly.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$("body").on("submit", "form", function(event) {
    event.stopPropagation();
    event.preventDefault();
    var type = "POST";
    var url = $(this, "form").prop("action");
  
    if (event.target.files) {
      var file = event.target.files;
      var elementos = $(this, "form")[0].elements;
  
      var data = new FormData();
  
      for (var i = 0; i &lt; elementos.length; i++) {
        element = elementos[i];
        data.append(element.name, element.value);
      }
  
      var file_data = $(file).prop("files")[0];
      data.append("files", file_data);
  
      var cache = false;
      var contentType = false;
      var processData = false;
    } else {
      var data = $(this, "form").serialize();
    }
  
    $.ajax({
        url: url,
        data: data,
        type: type,
        cache: cache,
        contentType: contentType,
        processData: processData
  
      })
      .done(function(data) {
        $(".section").html(data);
      });
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;input type="radio" name="genero" value="1"&gt; Hombre
  &lt;input type="radio" name="genero" value="2"&gt; Mujer</code></pre>
  </div>
  </div>
  </p>