Jump to content

Select box remove method compability


radalin

Recommended Posts

Hi,

I have a problem with a select box. I have created two select boxes and then two buttons with add and remove functions. The thing is my function works flawless in FF and Opera but it doesn't in IE. Instead of removing selected option it removes all of the select box.

[code]
function addinfo(from,to)
{
var i = from.selectedIndex ;

var myOption = document.createElement("OPTION") ;

myOption.value = from.item(i).value ;
myOption.text = from.item(i).text ;

to.options.add(myOption) ;

from.remove(i) ;

}
[/code]

Here is the function. It takes two select boxes as arguments. There is something that I miss, but can't see it.
Link to comment
https://forums.phpfreaks.com/topic/26103-select-box-remove-method-compability/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.