severndigital Posted October 28, 2008 Share Posted October 28, 2008 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. Quote Link to comment Share on other sites More sharing options...
F1Fan Posted October 28, 2008 Share Posted October 28, 2008 window.parent.document.getElementById('someid').value = whatever... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.