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.