0

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;
}
2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by twiss
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.