Can somebody please tell me how to refresh a page from another page?
This window loads up a small html page and asks the user to confirm that they wish to delete the contents of their cart.
If they choose yes, this removes the appropriate records from a database.
So that these changes are reflected on the main page, after the user confirms their desire to delete the records, I'd like this main page to be refreshed by the pop-up window.
Does anybody know if this is poss. please?
If I understand you right: yes, the updating is possible. (Though I wouldn't necessarily call it refreshing since that implies a reload.) Not having your script in front of me, I can only point you in the general direction.
What you need to do is to update the main window with the appropriate values from the child window. For example, you can use the opener property to add or subtract items from the shopping list. As in:
opener.document.formName.fieldName.value = 0;
The above would work if your link opens the child window, as in:
<a href='window.open(blahblah)'>Confirm List</a>
The only real concern I have is your mention of a database. Are you updating a database before and after the list is confirmed? If so, why? You should access the dbms only after confirmation, doing so before requires server time and slows things up somewhat.
Thank you for your answer - reload is what I'm actually seeking.
....PHP is doing the updating server side after user confirms.
Maybe I'm a little off today or missing something, but what's wrong with executing an opener.reload() or simply loading the location from the php script after the fields have been updated?
I was gonna ask the same question... but figured maybe lack of caffeine was inducing a brain hemorrhage that was rendering me insensible.
If you just want to load a new document in the main window, you can do:
opener.document.location = 'newURLhere';