Gossamer Forum
Home : General : Internet Technologies :

Pop-up window, and when you click a link, it puts an ID name in a read-only box?

Quote Reply
Pop-up window, and when you click a link, it puts an ID name in a read-only box?
Hi. I'm trying to do something, where you would click on a link, i.e;

View Cats

This would then open a new window up, with a list of categories. I then need some javascript that would cause a TEXT area to be populated with a category name that was clicked. i.e;

In the box we have;

/Root/Test
/Root/Test/Sub
/Root/Another
/Root/Something

...if I clicked on /Root/Test, then the window would close on its own, and the TEXT area in the main page would be populated with this value.

I know this is possible.. but I'm afraid to say my knowledge of Javascript is somewhat limited Frown

TIA

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Pop-up window, and when you click a link, it puts an ID name in a read-only box? In reply to
FWIW... I use the following to populate a fax coversheet (ie, click here to print cover sheet) which pops-up.

<script>if (window.opener.form.Purpose.value == "Purchase") {document.write('Sales Contract')};</script>

So if the pop-up's "parent" is window.opener then perhaps you could populate the textarea field with:

window.opener.form.fieldname.value = form.pop-upfieldname.value;

Not sure... but it's worth a try.
Quote Reply
Re: [Watts] Pop-up window, and when you click a link, it puts an ID name in a read-only box? In reply to
Do you have an example of where this is done?

TIA

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Pop-up window, and when you click a link, it puts an ID name in a read-only box? In reply to
See attached files... save main.htm and window.htm to the same directory and then launch main.htm and follow the directions.

This works in IE 6, not sure about other browsers.

I called the form NAME="form" if you name it anything else you'll need to change window.opener.form.value to window.opener.BOB.value (etc).
Quote Reply
Re: [Watts] Pop-up window, and when you click a link, it puts an ID name in a read-only box? In reply to
Thanks, but that didn't seem to do quite what I was looking for. I managed to get it working with the attached codes (open test.html, and then click the '...' button, which will open a button... you can then click an entry on that page, and it will complete the form data on the main page).

Thanks for the pointers though Smile

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Pop-up window, and when you click a link, it puts an ID name in a read-only box? In reply to
Cool. I've saved a copy of your code for future use.