populating ddl using javascript
-
using javascript, i have to populate a dropdownlist text and its values. for that i am getting name and its values in two variables namely "name" and "id". the ddl text is populated using this code, document.Auto.ddlComp.options[i] = new Option(name); // working fine but to populate its correspoding values for text i used, // document.Auto.ddlComp.options[i].value = new Option(id); its not working. please tell me how to populate the corresponding ddl values to its text. Regards, abul.
hello
-
using javascript, i have to populate a dropdownlist text and its values. for that i am getting name and its values in two variables namely "name" and "id". the ddl text is populated using this code, document.Auto.ddlComp.options[i] = new Option(name); // working fine but to populate its correspoding values for text i used, // document.Auto.ddlComp.options[i].value = new Option(id); its not working. please tell me how to populate the corresponding ddl values to its text. Regards, abul.
hello
-
if memory serves, you can do it when creating the option item: new Option(text,value,defaultSelected,selected);
thanks edboe...
hello