Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

101
Vistas
Convert Form Data into Request Data for an AJAX Request

I am trying to submit my form data via a POST AJAX request and cannot find any solutions.

I can't just get the values by ID or name etc because it is dynamically created depending on data from a database.

I have tried using the childNodes and think this may be a solution but cannot figure it out. Do I need to use JQuery? Can it be done with just JS as I'm a beginner.

Any ideas would be appreciated, cheers.

about 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

Did you tried below

$( "form" ).submit(function( event ) {
 ( var jsonData = $( this ).serializeArray() );
  event.preventDefault();
 // --- Your Ajax request
});
about 4 years ago · Santiago Trujillo Denunciar

0

What you can do is just give an id (here i am giving form_id) to the form

$('#form_id').submit(function(){
  e.preventDefault();
  $.ajax({
        type: "POST",
        url: "your_url",
        data: $('#form_id').serialize(),
        success: function (data) {
            alert('ok');
        }
  });
})

Cheers. :)

about 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda