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.

 

 

 

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.