Jump to content

Select values in popup window, insert into textbox of parent window


Eiolon

Recommended Posts

I am not sure what this is called so I can't find anything on Google about it.

 

But as an example, in some webmail systems, a user can click the TO link and a popup window with a list of their contacts will appear.  They can then select the contacts via check box and then have it applied to the text field in the TO field on the parent window.

 

Any ideas on how to go about doing that?

I have this semi-working.  I have the name being put in the TO field but I do not have the actual record ID of the name being sent to it.

 

My code:

 

<a href="#" onclick="window.opener.document.add.employee.value=window.opener.document.add.employee.value+'<?php echo $row_employees['name']; ?>; ';"><?php echo $row_employees['name']; ?></a>

 

If I change:

 

<?php echo $row_employees['name']; ?>

 

to

 

<?php echo $row_employees['id']; ?>

 

it simply sends the ID to the text box but not the name.

You'll have to add a hidden input box to store the ID in, so you can send back the ID and store that in the hidden input box so the user cannot see it, then show the name in the other input box which the user can see.

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.