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

206
Visualizações
Unable to redirect page on form submission in react

I'm trying to make an API call and redirect a page upon form submission using React. Here's some qualities of the issue I'm running into:

  • All that happens upon form submission is the page reloads
  • If I set the submission function to run on click, it will redirect the page as expected
  • Everything else in the function runs as expected upon submission

I've removed the API code as it's irrelevant for this question:

const Booking = () => {
const handleSubmit = () => {
window.parent.location = '/intuit-app/thankyou';}

  return (
    <>
      <Container>
        <FormWrap>
          <Icon to="/intuit-app">Intuit</Icon>
          <FormContent>
            <Form onSubmit={handleSubmit}>
              <FormH1>Enter your email, then pick a date and time for your consultation</FormH1>
              <FormLabel htmlFor='for'>Email</FormLabel>
              <FormInput type='email' onChange={handleInputChange} required />
              <FormButton type="submit" value="Submit"
              >Submit</FormButton>
            </Form>
          </FormContent>
        </FormWrap>
      </Container>
    </>
  )
}
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You forgot to prevent the default behavior of the browser.

const handleSubmit = (event) => {
    event.preventDefault();
    window.parent.location = '/intuit-app/thankyou';
}
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