thanx for ur reply.....i will give u my javascript code plz help me.
- function refresh()
-
{
-
-
var indexOfcombobox = document.form1.drughid.value;
-
sel = document.form1.drug;
-
for (i=0; i<sel.options.length; i++) {
-
if (sel.options[i].text ==indexOfcombobox ) {
-
sel.selectedIndex = i;
-
}
-
}
-
}
Here drug is the name of the select box.
and Drughid is the name of the textbox.
and now i have to compare the value of the textbox with the option of the choice box.
And if the choice box option value becomes equal to the textbox value i have to set that index.
I call the refresh function on "<BODY onload="refresh()">"
can u suggest me any solution.
Actualy am geting error that
"sel.options .length" is null or not a object...
plz give me some solution...
Thanx in advance...
give your select node an id and use childNodes.length like this:
- function get_child_nodes_length(id) {
-
var sel_node = document.getElementById(id);
-
return sel_node.childNodes.length;
-
}
-
kind regards