Add option to select list in FBML with appendChild()
function addOption(id, value, text) {
var select = document.getElementById(id);
var option = document.createElement('option');
option.setValue(value).setTextValue(text);
select.appendChild(option);
}Remove option from select list in FBML with removeChild()
var choiceList = document.getElementById('someID');
var count = choiceList.getOptions().length - 1;
var node = choiceList.getOptions()[count];
choiceList.removeChild(node);
Clear all options at once
function clearAllOptions(id) {
document.getElementById(id).setTextValue('');
}
Email this
Hits: 888
Comments (1)

Write comment


