Hi
You might "convert" the var "popupWin" into a "global" variable.
You can do this by moving the var outside the function, and
then check if the popupWin allready is an object (that is it is open).
If it is open then replace the URL of the window's document
instead of opening a new window with window.open():
var popupWin = '';
function EnterDetails($btnname) {
if (typeof popupWin != 'object') {
// the window is not created
popupWin
window.open("newproject.php?name="+document.frmJob.cbbxName.value+"&project
"+document.frmJob.cbbxProject.value+"&phase="
+document.frmJob.cbbxPhase.valu
e+"&type="+'project',"Addnew",sFeatures);
} else {
// the window does exist, lets change the URL
popupWin.document.location = "newproject.php?name="
+document.frmJob.cbbxName.value+"&project
"+document.frmJob.cbbxProject.value+"&phase="
+document.frmJob.cbbxPhase.valu
e+"&type="+'project'
}
That's it! (I hope!) :-)
Have a nice week-end!
Sten Hougaard
EDB Gruppen
Application developer/web-designer