radalin Posted November 3, 2006 Share Posted November 3, 2006 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 More sharing options...
fenway Posted November 4, 2006 Share Posted November 4, 2006 Sounds like "i" isn't the same in both browsers. Link to comment https://forums.phpfreaks.com/topic/26103-select-box-remove-method-compability/#findComment-119413 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.