Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

add option to popup parent window element

Status
Not open for further replies.

joezapp

Programmer
Feb 26, 2001
63
0
0
GB
apologies if this has been asked before, search is still down so..

this is what I'm after:

user clicks on a link.
opens a popup window containing text field and button.
user enters text and submits.
This text is added to a select object on the parent window. Popup closes.

I'm trying to use the below script on the popup (I can see the select object and can see its values, its just the add bit that doesn't seem to work. of course it may not be possible/allowed...

<SCRIPT language=&quot;Javascript&quot;>
function addItem(what) {
var oSel = opener.formname.selectname;
var oEle = document.createElement('option');

oEle.value = what;
oEle.text = what;
oSel.add(oEle);
oSel.value = what;

self.close();
}
</SCRIPT>

thanks

Joe.







 
sorted (if anyone is interested):

should have been:
var oEle = opener.document.createElement('option');

rather than:
var oEle = document.createElement('option');

simple !


Joe.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top