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

232
Visualizações
window.opener.location.reload() works unless pop-up window loads new page

I am looking for a solution to a problem I encountered returning to the parent page.

I have a main page with a form, each field in the form uses jQuery autocomplete and also an onChange that submits the form. The submit target is the same page unless the form is full, complete and validated in which case it send the data to the database.

If after submitting the validation finds that the field has a new unique entry it calls a pop-up window

window.open('add.php?table=costume', 'add_data')

The PHP page (add.php) then adds the field data into the database for future use and validation.

All works well, the child window immediately saves the data and gives me a confirmation message. The end of the child page has the window.opener function to close and go back to the parent

function goBack() {
   window.opener.location.reload();
   window.close();
}

But if I try to submit anything on the child page which reloads the child page.. ie a "Are you sure Y/N?" then the window opener breaks and takes me back to the previous page in that window.

I want to be able to go back to the parent page and for it to reload, after the field data has been added to the database so that the parent page can validate itself again with the new data.

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