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

184
Vistas
My form is automatically submitting when i make a ajax call

I am having a form which will submit list of products to the spring backend

I have two separate buttons 1). Submit button to submit the form 2). Fetch available Stock button to check stock availability

When i click Fetch available stock button -- it will invoke a function which will make Ajax call to fetch stock details

But the problem is whenever i click Fetch available stock button

Both ajax call for fetching stock data and form submission also happens.

I don't want the form to submit till i press the submit button

Note: i am having the form in bootstrap modal

Thanks in advance for helping me!

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

without the code we can't do match but I suggest in the form submitting code you should use e.preventDefault() to prevent the default behavior of submit button and after you complete all your logic you should submit the form.

about 4 years ago · Juan Pablo Isaza Denunciar

0

add the attribute type="button" to the button

about 4 years ago · Juan Pablo Isaza 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