First up, <script = "Javascript1.2"> is meaningless... Should be  
<script language="Javascript1.2"> or, better: <script type="text/ 
javascript">.


Your main problem, however, is that

   var list = document.getElementById("MemberName").value;

..is also wrong. You're trying to access the select item, not its  
value (which doesn't actually exist), at this point. So:

   var list = document.getElementById("MemberName");

Your "list" then has an array of options, and the rest of the code  
should work fine.


Seb


Seb Duggan
Web & ColdFusion Developer

e:      [email protected]
t:      07786 333184
w:      http://sebduggan.com

On 16 Feb 2009, at 16:44, Austin Band wrote:

>
> Hello, I need a little help. I have javascript that works with IE  
> but not FireFox.
>
> The code:
>
> <script = "Javascript1.2">
> function addItemsToParent(){
> var MemberList= "";
> var list = document.getElementById("MemberName").value;
> for(var i=0; i<list.options.length; ++i)
>       if(list.options[i].selected){
>               MemberList = MemberList + ","+list.options[i].value;
>                               }
>       opener.document.MemberName.value = MemberList;
>       self.close();
>       }
> </script>
>
> The error returned in Error Console is that the list is null. This  
> works correctly in IE. The goal is to select a name and it displays  
> in the textbox
>
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:319380
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to