Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

222
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!