I know this question has been asked several times in this forum, however all the answers I could find are sadly not clear enough to me.
I want to give the Popup list from example pack 1 a try. It works great and I was able to rebuild it for my local XAMPP server. So, no complaints about this example yet.
But... this example from example pack 1 only looks up 1 field (department_manager_id). I really want to use it to fill
two or more textboxes.
I have found an answer (dated 2005)
http://forums.yessoftware.com/posts.php?post_id=60240&s_keyword=popup
but
bou63 confuses me when he mentions
ApplicantName,ApplicantID,ApplicantNamePhone,Company etc. which he uses succesfully in his project.
For my test environment I use the standard IntranetDB tables:
departments
employees
with the following fields:
department_id
department_name
department_manager_id
for the departments table, and
emp_id
emp_login
emp_password
emp_name
title
group_id
department_id
phone_home
phone_work
phone_cell
fax
email
city
zip
address
picture
for the employees table;
What do I have to do with my codes in order to fill two or more textfields on my PopUpList page (based on the tables from IntranetDB as mentioned above)
Thanx,
Markie
By the way, my javascript code on PopUpList is:
<script language="JavaScript" type="text/javascript">
function OpenPop_UpList()
{
var FieldValue;
if (document.departments.is_change.value == 1) {
FieldValue = escape(document.departments.department_manager_id.value);
} else {
FieldValue = "";
}
var linkhref = document.getElementById("EmployeesList").href;
var win=window.open(linkhref+"?s_emp_name="+FieldValue, "EmployeesList", "left=100,top=10,width=480,height=480,status=no,toolbar=no,menubar=no,location=no,scrollbars=yes");
win.focus();
}
</script>
and my javascript on the PopUpList_Window is:
<script language="JavaScript" type="text/javascript">
function SetOpenerValue(currentObj)
{
var IE = (document.all) ? 1 : 0;
if(IE) {
var EmpName = currentObj.innerText;
} else {
var EmpName = currentObj.text;
}
window.opener.document.departments.department_manager_id.value = EmpName;
window.opener.focus();
window.close();
}
</script>
The html link on PopUpList_Window is:
<a href="{emp_name_Src}" onclick="SetOpenerValue(this);return false;">{emp_name}</a>