[Javascript] Adding an item to a select list from another window

Robert Pollard rpollard at apple.com
Thu Sep 25 10:25:49 CDT 2003


What I am trying to accomplish is this:

1.	I have a window that has Select list.  When I select New it will  
open another window to select the items I want to add to the list.
2.	When I select the items from the second window I need to create a  
comma delimited list of the items selected in the second window by  
command/option clicking the items I want, create an element in the list  
in the first window and update the newly created list element in the  
first window with the comma delimited items that were selected in the  
second window.

Too many windows to follow here but I hope you understand what I am  
trying to accomplish.

I had previously built code to open a list of options from a Select  
list in a second window and the list would update a field in the first  
window with a comma delimited list of items selected from the second  
window.  Now I want to create a new Option list element in the first  
window and update that instead of a field.

I hope this helps understand what I am trying to accomplish.

Thanks for all your feedback so far,

Robert

On Wednesday, September 24, 2003, at 07:39 PM, Robert Pollard wrote:

> Hello all,
>
> I hope this is not too much of challenge but I have been having bad  
> luck with it.
>
> I am executing this code from another window.  I have a lot of code  
> that updates fields in the opening window from the opened window.  All  
> my code works except this:
>
> 	var vFields = new Option(commaDelimitedList, "",false,false);
> 	var j = window.opener.document.forms[0].elements[aValue[i]].length;
>
> It's good up until here.  This next line causes Explorer to  
> unexpectedly quit.
> 	 
> window.opener.document.forms[0].elements[aValue[i]].options[j].options[ 
> j] = vFields;
> This next line just returns a no object error.
> 	window.opener.document.forms[0].elements[aValue[i]].options[j].value  
> = commaDelimitedList;
>
> Platform is Mac OS X 10.2.3
> Explorer: 5.2
>
> Any ideas why this wouldn't work?  Notice the second line actually  
> returns a value.
>
> Thanks for any insight,
>
> Robert Pollard
>
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript




More information about the Javascript mailing list