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

148
Vistas
How to detect if the form has been submitted?

I have form in react.
And I need to detect if the form has successfully been submitted to make a next request in another form

const formRef = React.useRef<HTMLFormElement>(null);

  useEffect(() => {
    if (formRef && formRef.current) {
      formRef.current.submit();
    }
  }, [formRef]);

 <>
          <form
            id="tdsMethodAcs"
            method="post"
            target="methodAcsFrame"
            action={three_ds_method_url}
            style={{ display: "none" }}
            ref={formRef}
          >
            <input
              type="hidden"
              name="methodAcsFrame"
              value={method_data_packed}
            />
            <input type="submit" />
          </form>
          <iframe name="tdsMethodAcsFrame" width="0" height="0"></iframe>
        </>
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Probably the shortest way is to create a variable in the state to which you change the value when the form is submitted. Somethink like this:

const [formSubmitted, setFormSubmitted];
const onSubmit = () =>{
  //Do stuff
  setFormSubmitted(true);
}
useEffect(()=>{
   //Do another stuff
},[formSubmitted])
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