Jump to content

populate parent webpage with data from php array


severndigital

Recommended Posts

I have a parent page that opens a pop to list addresses.

 

I want the child window to populate the parent fields with the correct data.

 

My problem is this

 

how do i tell javascript which information to use?

 

My child window is pulling the addresses from mySQL and displaying

 

I don't understand how to pass the information through to Javascript.

 

is there an easier way than this

 

<javascript>
function address(id,firstname,lastname,company,address1,address2,city,state,zip,phone,email){
passing info goes here
}

<php>
for($i = 0; $i < count($addressList; $i++){
<a onclick="address(\'' . $id . '\'. $firstname .'\'. $lastname .'\' etc...>Lastname, Firstname</a>
}

 

just seems like a whole lot of coding, which generally means there is a better way.

 

thanks,

Chris

 

BTW .. i know the code on the screen will not work as is, i am just serving up and example of the coding that i have.

 

 

 

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.