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

182
Vistas
Chain methods with AJAX calls so that they execute in sequential order

I have a React web form with complex validation that runs each time a focus() or blur() happens on each HTML form field. Each of those field events is associated with one or more JavaScript methods. Within those JavaScript methods we do AJAX calls to validate the data entered into the form field (e.g. check to see if the vendor ID is found in the ERP software, etc.).

Now that I've completed all of the field validation logic, I want to include logic on the Submit button where once more it cycles through each of the form fields and executes the relevant validation-related JavaScript methods.

The problem is, these methods need to be called in a particular order. And, in most instances, we need to wait for the AJAX calls embedded in the JavaScript method to finish before moving on to the next call.

I've looked at JavaScript Promises but is it possible to have the Promise wait for the embedded JavaScript AJAX call to complete before moving on to the next then()?

over 4 years ago · Santiago Trujillo
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