Discussion Locked

Popup window + closing the child window

0 helpful
1 reply
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I have one form with a 2 text box and a command buton or a link .
first textbox for department no and
second textbox to get the employee id (from a different form.)
when i click the command button or link there should open a new form(second form/child form) which reterives the values from an asp page based on the first textbox values and a hyper link to the employee name of id.
when i select the employee name or id in the popup window ie the child form or the second form should be closedand the value of the empid or name should be automatically be placed in the calling form or parent form.

Example if i enter the 10 in the text box then it should reterive all the employes in the department 10 . when i select the employee the employee id should be placed in the first form (parent form ) and close the child form automatically.

Thank you in advance.
from
madhu

1 reply

by geoffreyc

G'day Madhu,
This is assuming you wish to use JavaScript:

The onclick action of your button on the parent should call a function such as openChild() which would be defined as:
function openChild() {
var deptID = document.form.DeptIdfield.value;
var myURL = 'DeptList.asp?ID=' + deptID;
var childWin = window.open( myURL, 'childWin', 'width=650,height=550');
childWin.focus();
}

Then in the DeptList.asp, the employee selection link can call a function such as:
function returnEmpID(empID) {
opener.setEmployeeID(empID);
self.close();
}

In the parent page, you have the setEmployeeID function:
function setEmployeeID(empID) {
document.form.EmpIDfield.value = empID;
}

This discussion is closed to new replies.