Sam wrote:
I am constructing a company intranet.
On the intranet I made an overview-page which displays the availability of
equipment.
The information comes out of a database, and is retrieved by php-script.
The users of the database should be able to change the status of the
equipment.
On the overview-page, I placed a button next to each piece of equipment.
On pressing the button, a new window is opened, in which the user can input
the changes.
On this new window, a "submit"-button and a "cancel"-button can be pressed.
On pressing the submit-button, a php-script is called to make the changes in
the database, on "cancel", the new window is closed.
After pressing the submit-button, I want the initial overview-page to be
reloaded (refreshed) with the new information.
Can anyone help me?
I already tried this, but nothing happens:
The overview-page contains the following script:
<script language="JavaScript" type="text/JavaScript">
window.name = "materieeloverzicht"
</script>
The window.name is just a string for the target. The window name does
not do much really except in js disabled contexts.
The php page contains the following script:
<script language="JavaScript" type="text/JavaScript">
materieeloverzicht.location.reload()
</script>
You need here a window object reference (not a window name) and you need
to set the reload to true so that a refresh (unconditional get) at the
server is mandatory.
Let's say you did:
<script type="text/css">
var WindowObjectReference = null; // must be global scope
function OpenWindowEquipmentAvailability()
{
if(WindowObjectReference == null || WindowObjectReference.closed)
{
WindowObjectReference = window.open(strUrl, strWindowName,
strWindowFeaturesList);
};
}
</script>
then later you can reload that window with changes thanks to
<script type="text/javascript">
WindowObjectReference.location.reload(true);
</script>
You could even combine both script content into 1 single one.
To close after a click of the cancel button, you would call in this order:
WindowObjectReference.close();
WindowObjectReference = null;
DU
--
Javascript and Browser bugs:
http://www10.brinkster.com/doctorunclear/
- Resources, help and tips for Netscape 7.x users and Composer
- Interactive demos on Popup windows, music (audio/midi) in Netscape 7.x
http://www10.brinkster.com/doctorunc...e7Section.html