Show content in a external windows (overlay from jQuery Tools for example) and passing data to the main window

Show content in a external windows (overlay from jQuery Tools for example) and passing data to the main window

Hi every, I've a page where it's supposed to open a new window and show some content from DB with pagination and so on. In that window I have a link "Agregar" and when I click there the row or the content of the row should go to a input in the main page but storing different values, for example: ID, NAME because if I insert only ID then the users can't know what they insert. Also I need to insert more than one record, any help? I was thinking in have a main input and a hidden input and put values separately but don't know how to. 
Cheers and thanks in advance