title: Submit a form in the background with ajax
body: <p>I have the following problem, I am using Prestashop and I need a form to make a submit in the background, I have investigated and I found a way to do it with ajax but I need the url and data parameter that I do not know how to get them since the form is this.</p>
  <p>As you can see, the form has no action and the data is not clearly visible, this would be the way I have in mind to do it with ajax:</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>$(document).ready(function() {
    $("#makePdfCatalogue").submit(function(e) {
      e.preventDefault();
      var dataString = $("#makePdfCatalogue").serialize(); //this way i cant get the data
      console.log(dataString);
  
      $.ajax({
        type: "POST",
        url: "", //action doenst appear 
        data: dataString,
        success: function(msg) {
          console.log('working: ' + msg);
        },
        error: function(msg) {
          //console.log('not working ' + msg);
        }
      });
    })
  })</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;form id="makePdfCatalogue" name="makePdfCatalogue" method="POST" enctype="multipart/form-data"&gt;
    &lt;div class="row"&gt;
      &lt;div class="col-md-6"&gt;
        &lt;fieldset&gt;
          &lt;legend&gt;Categorías&lt;/legend&gt;
          &lt;div class="form-group"&gt;
            &lt;label class="" for="name"&gt;{l s="Selecciona la categoría/s que deseas exportar" mod="custompdfexport"}&lt;/label&gt; {$categories_tree}
          &lt;/div&gt;
        &lt;/fieldset&gt;
      &lt;/div&gt;
      &lt;div class="col-md-6"&gt;
        &lt;fieldset&gt;
          &lt;legend&gt;Datos empresa&lt;/legend&gt;
          &lt;div class="row"&gt;
            &lt;div class="col-md-12"&gt;
              &lt;div class="form-group"&gt;
                &lt;label class="" for="name"&gt;Nombre Empresa&lt;/label&gt;
                &lt;input type="text" name="name" placeholder={l s="Nombre Empresa..." mod="custompdfexport" } class="form-control" id="name"&gt;
              &lt;/div&gt;
            &lt;/div&gt;
          &lt;/div&gt;
          &lt;div class="row"&gt;
            &lt;div class="col-md-12"&gt;
              &lt;div class="form-group"&gt;
                &lt;label class="" for="contact"&gt;Datos contacto&lt;/label&gt;
                &lt;input type="text" name="contact" placeholder={l s="Datos Contacto..." mod="custompdfexport" } class="form-control" id="contact"&gt;
              &lt;/div&gt;
            &lt;/div&gt;
          &lt;/div&gt;
          &lt;div class="row"&gt;
            &lt;div class="col-md-12"&gt;
              &lt;div class="form-group"&gt;
                &lt;label class="" for="logo"&gt;Logo empresa&lt;/label&gt;
                &lt;input type="file" name="logo" placeholder={l s="logo Empresa..." mod="custompdfexport" } class="form-control" id="logo"&gt;
              &lt;/div&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/fieldset&gt;
        &lt;fieldset&gt;
          &lt;legend&gt;Opciones&lt;/legend&gt;
  
          &lt;div class="row"&gt;
            &lt;div class="col-md-3"&gt;
              &lt;div class="form-group"&gt;
                &lt;label class="" for="form-password"&gt;{l s="Diseño" mod="custompdfexport"}&lt;/label&gt;
                &lt;ul&gt;
                  &lt;li&gt;
                    &lt;input type="radio" name="format" class="form-control" value="2" id="format-2"&gt;&lt;label for="format-2"&gt;{l s="2 columnas" mod="custompdfexport"}&lt;/label&gt;
                  &lt;/li&gt;
                  &lt;li&gt;
                    &lt;input type="radio" name="format" class="form-control" value="3" id="format-3"&gt;&lt;label for="format-3"&gt;{l s="3 columnas" mod="custompdfexport"}&lt;/label&gt;
                  &lt;/li&gt;
                  &lt;li&gt;
                    &lt;input type="radio" name="format" class="form-control" value="4" id="format-4"&gt;&lt;label for="format-4"&gt;{l s="4 columnas" mod="custompdfexport"}&lt;/label&gt;
                  &lt;/li&gt;
                &lt;/ul&gt;
              &lt;/div&gt;
            &lt;/div&gt;
            &lt;div class="col-md-5"&gt;
              &lt;div class="form-group"&gt;
                &lt;label class="" for="form-password"&gt;Opciones&lt;/label&gt;
                &lt;div class="form-group"&gt;&lt;input type="checkbox" name="options[]" class="form-control" id="opt-wt" value="wt"&gt;&lt;label for="opt-wt"&gt;{l s="Mostrar Precios con Iva" mod="custompdfexport"}&lt;/label&gt;&lt;/div&gt;
                &lt;div class="form-group"&gt;&lt;input type="checkbox" name="options[]" class="form-control" id="opt-wot" value="wot"&gt;&lt;label for="opt-wot"&gt; {l s="Mostrar Precios sin Iva" mod="custompdfexport"}&lt;/label&gt;&lt;/div&gt;
                &lt;div class="form-group"&gt;&lt;input type="checkbox" name="options[]" class="form-control" id="opt-ref" value="reference"&gt;&lt;label for="opt-ref"&gt;{l s="Mostrar referencia" mod="custompdfexport"}&lt;/label&gt;&lt;/div&gt;
                &lt;div class="form-group"&gt;&lt;input type="checkbox" name="options[]" class="form-control" id="opt-link" value="link"&gt;&lt;label for="opt-link"&gt;{l s="Enlazar productos con web" mod="custompdfexport"}&lt;/label&gt;&lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;
            &lt;div class="col-md-4"&gt;
              &lt;div class="form-group"&gt;
                &lt;label class="" for="revenue"&gt;Margen comercial (%)&lt;/label&gt;
                &lt;input type="text" name="revenue" placeholder={l s="Margen comercial..." mod="custompdfexport" } class="form-control" id="revenue" style="width: 100px;"&gt;
              &lt;/div&gt;
              &lt;div class="form-group"&gt;
                &lt;label class="" for="revenue"&gt;Descuento (%)&lt;/label&gt;
                &lt;input type="text" name="reduction" placeholder={l s="Descuento..." mod="custompdfexport" } class="form-control" id="reduction" style="width: 100px;"&gt;
              &lt;/div&gt;
            &lt;/div&gt;
          &lt;/div&gt;
          &lt;div class="row"&gt;
            &lt;div class="col-md-6"&gt;
              &lt;label class="" for="form-password"&gt;Ordenar&lt;/label&gt;
              &lt;div class="form-group"&gt;&lt;input type="radio" name="order" class="form-control" id="order-asc" value="price_asc"&gt;&lt;label for="order-asc"&gt;{l s="Por precio de Menor a Mayor" mod="custompdfexport"}&lt;/label&gt;&lt;/div&gt;
              &lt;div class="form-group"&gt;&lt;input type="radio" name="order" class="form-control" id="order-desc" value="price_desc"&gt;&lt;label for="order-desc"&gt;{l s="Por precio de Mayor a Menor" mod="custompdfexport"}&lt;/label&gt;&lt;/div&gt;
            &lt;/div&gt;
            &lt;div class="col-md-6"&gt;
              &lt;label class="" for="form-password"&gt;Stock&lt;/label&gt;
              &lt;div class="form-group"&gt;&lt;input type="checkbox" name="stock" class="form-control" id="stock" value="stock"&gt;&lt;label for="stock"&gt;{l s="Seleccionar sólo artículos con stock"}&lt;/label&gt;&lt;/div&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/fieldset&gt;
        &lt;br&gt;
        &lt;input type="hidden" name="token" value="{$token|escape:'html':'UTF-8'}" /&gt;
        &lt;input type="submit" name="submitMakePdfCatalogue" id="submitMakePdfCatalogue" value="{l s='Generar' mod='custompdfexport'}" class="exclusive" /&gt;
  
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/form&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>any suggestion of how to get those parameters...</p>