Re: Weird problem with script

Davo
Tue, 19 Dec 2006 02:24:16 -0000

Found the problem ..
i = 0;
for (x=1; x<=suburbArray.length; x++)
{
	splitstring = suburbArray[x].split(", ")
	for (y in selectedArray)
	{
		if(selectedArray[y] == splitstring[0])
		{
		document.frm_master.D3.options[i] = new Option(splitstring[2],
splitstring[1], false, true);
		//document.write(splitstring[0] + '' '' + splitstring[1] +
'' '' +
splitstring[2] + '' '' + i + '' '')
		i++;
		}
		if (i == 0)
		{
		document.frm_master.D3.options.length=0;
		}
	}
}
the above fixed it, something to do with using a regular array not
working with prototye.js .. that being said new at javascript would be
good if anyone reads this and wants to advise if improvements could be
made on this??

cheers


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Spinoffs" group.
To post to this group, send email to
rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---