java script urgently.....
Web Development
2
Posts
2
Posters
0
Views
1
Watching
-
-
hi.... i have a dropdownlist and listbox having same items(string)... when i select an item frm dropdownlist ,the same item(string) should be removed from the listbox......i need java script coding since its client side....... adarsh m_squared
Hi there, a whole lot of code (for once i made an example out of it). You'll see it does work!
function go() {
var optionCounter;
var smalllist = document.getElementById('smalllist');
var biglist = document.getElementById('biglist');var selectedValue = smalllist.options\[smalllist.selectedIndex\].value; for(optionCounter = 0; optionCounter < biglist.length; optionCounter++) { if(biglist.options\[optionCounter\].value == selectedValue){ alert(biglist.options\[optionCounter\].text + " will be removed"); biglist.options\[optionCounter\] = null; } }
}
one two tree four five six seven eight nine ten one two tree four five six seven eight nine ten