Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

328
Views
¿Cómo puedo corregir el error 400 (Solicitud incorrecta) de ajax al cambiar el formulario jquery?

Hola chicos, tengo un problema cuando estoy tratando de enviar datos por ajax y se dice que tengo 400 (Solicitud incorrecta) errores de ajax y este es mi código:

Este es el código Html: las filas son datos de mi base de datos $ fila ['atributos'] que tiene (tamaño, marca, color ......)

 <form id="form"> <?php foreach($rows as $row): ?> <fieldset> <?php $result_attributes = get_terms([ 'taxonomy' => $row['attributes'], 'hide_empty' => false, ]); ?> <select id="select-wid" name="<?php echo $row['attributes']?>"> <option value="">Select</option> <?php foreach($result_attributes as $result_attribute) : ?> <option value="<?php echo $result_attribute->term_id; ?>"><?php echo $result_attribute->name; ?> </option> <?php endforeach; ?> </select> </fieldset> <?php endforeach;
Este es el código jquery:
 (function($){ $(document).ready(function(){ $(document).on('change', '#form', function(e) { var data = $(this).serialize(); e.preventDefault(); console.log(data); $.ajax({ url: my_url, data: data, action: 'myactionfunction', type: 'post', success: function(result) { $('.products').html(result); }, error: function(result) { console.warn(result) }, }); }); }); })(jQuery);

Imagen de la consola ingrese la descripción de la imagen aquí

Imagen de php ingrese la descripción de la imagen aquí

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!