hi all,
i got two list box that moving item within each other
and they are operate by my "->" "<-" button
here the function code in java i wrote but it in firefox work perfectly
but it dosen't work in google chrome....anyone know where is the problem of my code?

function MyMoveItem(fromObj, toObj)
{
   for (var selIndex = fromObj.length - 1; selIndex >= 0; selIndex--)
   { 
      // Is this option selected?
      if (fromObj.options[selIndex].selected)
      {
         // Get the text and value for this option.
         var newText  = fromObj.options[selIndex].text;
         var newValue = fromObj.options[selIndex].value;

		 if(fromObj.id =="SelectList")
		 {	 // Delete the option in the first select box.
		 	if (fromObj.options[selIndex].style.display=="none")
			 fromObj.options[selIndex].style.display="none";
			else{// Create a new option, and add to the other select box.
			 fromObj.options[selIndex].style.display="none";
			 var newOption = new Option(newText, newValue)
			 toObj[toObj.length] = newOption;}
		 }
		 else
		 {
			for(var selIndex2 = toObj.length - 1; selIndex2 >= 0; selIndex2--)
			{	
				if(toObj.options[selIndex2].value == newValue )
				   toObj.options[selIndex2].style.display="block";
			}
			fromObj[selIndex] = null;
		 }
      }
   }
   fromObj.selectedIndex = -1;
}

Do you get an error in Chrome?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.