Forum Moderators: open

Message Too Old, No Replies

Child Window radio button needs to populate Parent textarea

I'm a bit stuck, help needed.

         

The Cricketer

2:06 pm on Aug 5, 2005 (gmt 0)

10+ Year Member



I have a number of radio buttons in a form within a child pop up window. When I select a radio button within this form and then click the INSERT button I need the radio button's value to populate a textarea in the parent window.

My javascript knowledge is pretty weak, but I would appreciate any help or advice on how I could do this and the code needed.

garann

8:17 pm on Aug 5, 2005 (gmt 0)

10+ Year Member



I think all you need to do would be:

1. Create a Javascript method on the parent page that takes a value and populates your textarea with that.
2. When someone clicks the button in your child window, use something like

onclick="window.opener.nameOfFunctionYouJustCreated('newValueForTextarea');

NoLimits

4:23 pm on Aug 6, 2005 (gmt 0)

10+ Year Member



You could avoid the "insert" button all together and have the text area update with every change of the check boxes by adding the following script to your check boxes.

onChange=parent.window.TextAreaName.value='What the textarea/box should say'

or to keep the "insert" button, you can use the tag posted already, either in its function, or by putting the function itself in your link.