I'm having trouble getting this code working 100%. Any help would be great!
Basically, I want the dropdown to display "Select from the list", but as soon as it gets focus I want that item to be deleted. When they move off the dropdown I want that item to be re-added (assuming they have selected at least item 2 (item 1 is "add new"). Alternatively, if you can suggest a cleaner way to give them an instruction without having a label...
This is what I have so far, but it keeps removing items 0 AND 1 for some reason :S. The Action variable is passed from onblue and onfocus.
- Code: Select all
if (Action==1) {
if (cbo.options[cbo.selectedIndex].text=="Select from the list")
cbo.remove(0);
}else if (Action==0) {
if (cbo.value==0) {
cbo.options[0] = new Option('Select from the list?', -1);
cbo.value=0;
}
}

