can someone help me with this please?
I am dynamically changing the size of a <select> depending on how many options:
but this doesnt work.
Trying to learn Javascript in notepad is a pain in the ...
Tracey
Remember... True happiness is not getting what you want...
Its wanting what you have got!
I am dynamically changing the size of a <select> depending on how many options:
Code:
for (var i=0; i < objNodeList.length; i++) {
bob.comboResults.options[i]=new Option(objNumberList.item(i).text + ' - ' + objNodeList.item(i).text, objindex.item(i).text);
bob.comboResults.size=i+1;
}
however, if there is only one node in objNodeList, the select sizes to 1, but you cant see the record selected.
how can i say "if objNodeList.length = 1 {selectit}"??
i tried:
[code]
if (objNodeList.length = 0) {
document.getElementById("comboresults").selectedindex=document.getElementById("comboresults").options.length;}
Trying to learn Javascript in notepad is a pain in the ...
Tracey
Remember... True happiness is not getting what you want...
Its wanting what you have got!