Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

157
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda