I have 2 HTML files that I’d like to have interact. One file has a button that opens a new window with the 2nd file which is actually an ASP page. When I submit the ASP page, I want to have the child window call a function in the parent using the values that were used in the ASP post. However, my code doesn’t appear to be working. I’m getting into the function in my child window to call the parent’s function, but the code in the parent isn’t running. Can someone help me?
Here is the code I have.
First, in the parent, in the javascript portion:
[code=html]function updateJackTbl(unit, name, jack, term, back){
alert(“In updateJackTbl”);
tbl = document.getElementById(“unitTbl”);
if (unit==”A”) {
numRows = tbl.getElementsByTagName(“TR”).length-2;
row = tbl.rows(numRows);
} else {
numRows = tbl.getElementsByTagName(“TR”).length-1;
row = tbl.rows(numRows);
}
tblRef.deleteRow(row);
newRow = tblRef.insertRow(numRows);
newCell = newRow.insertCell(0);
newTxt = document.createTextNode(unit);
newCell.appendChild(newTxt);
}
Then, in the child window, I have the following. First in the script section, I have:
[CODE]function updateOpenerTbl() {
alert(“call updateJackTbl “+window.opener)
var unit = “A”;
var uName = “Test”
var rID = 500;
var cblID = 1058;
var term = “P3”;
var bckshl = “N/A”;
var jNum = “J4”;
window.opener.updateJackTbl(unit, uName, jNum, term, bckshl);
window.close();
}
And the <body> tag has:
[CODE]<body onload=”javascript:updateOpenerTbl()”>
Again, I’m getting the alert that says “call updateJackTbl [object]”, but I’m not getting “In updateJackTbl”.
I hope someone can help. It would be very much appreciated.
Chris