CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Lookup and pass multiple fields with Popup

Print topic Send  topic

Author Message
Markie


Posts: 251
Posted: 08/19/2007, 2:06 PM

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>
_________________
The Netherlands, GMT+1
Tools: CCS 5.1, Windows 7, Navicat, Ultraedit
Local server: XAMPP with Apache, php and MySQL
Webserver: Windows 2008 IIS 7, php and MySQL
View profile  Send private message
klwillis


Posts: 428
Posted: 09/03/2007, 11:01 AM

One approach you can take is to extend example 1 yourself by passing
back two concatinated parameters (seperated by a '|'). Then parse out
the two parameters and populate the text fields in the parent window.

Quote Markie:
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>

_________________
Kevin Willis, VP/CIO
HealthCare Information Technology Specialist
http://www.nexushealthcare.com
"Fast - Convenient - Quality-Care"

Medical Software Consulting Services
Email : klwillis@nexushealthcare.com
Skype : klwillis2006
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.