Hi
I have been reading this thread:http://www.telerik.com/community/forums/aspnet-ajax/combobox/combo-box-color-picker.aspx
As I want to change the background colour of the selected item when an item in my dropdown is selected.
It gives this bit of javascript to do the job, but it's obviously very old as no longer works in the same way.
I have changed it to:
but the "document.getElementById(combo.InputID); " does not work, as i expected it wouldn't but I don't know what the replacement if it is?
Can anyone help?
Bex
I have been reading this thread:http://www.telerik.com/community/forums/aspnet-ajax/combobox/combo-box-color-picker.aspx
As I want to change the background colour of the selected item when an item in my dropdown is selected.
It gives this bit of javascript to do the job, but it's obviously very old as no longer works in the same way.
function onClientSelectedIndexChanged(item) |
{ |
var combo = item.ComboBox; |
var comboInput = document.getElementById(combo.InputID); |
//here ItemColor is a custom attribute that you can assign in ItemDatabound event |
comboInput.style.backgroundColor = item.Attributes.ItemColor; |
} |
</script> |
I have changed it to:
function
onClientSelectedIndexChanged(sender, eventArgs) {
var
combo = eventArgs.get_item();
var
comboInput = document.getElementById(combo.InputID);
//here ItemColor is a custom attribute that you can assign in ItemDatabound event
comboInput.style.backgroundColor = item.Attributes.ItemColor;
}
but the "document.getElementById(combo.InputID); " does not work, as i expected it wouldn't but I don't know what the replacement if it is?
Can anyone help?
Bex