Populating dropdownlist with javascript [modified]
-
Hi I am populating a dropdownlist using javascript.My code is given below.the problem is that my code works properly in Mozila,Opera.but fails to work in IE.
function popDDL()
{
var ddl=document.getElementById('<%= DropDownList1.ClientID%>');
for(var i=0;i<10;i++)
{
ddl.options[ddl.options.length]=new Option("item"+i,"item"+i);
}
}It says object doesn't support this property or method
CC26
modified on Friday, June 19, 2009 5:31 AM
-
Hi I am populating a dropdownlist using javascript.My code is given below.the problem is that my code works properly in Mozila,Opera.but fails to work in IE.
function popDDL()
{
var ddl=document.getElementById('<%= DropDownList1.ClientID%>');
for(var i=0;i<10;i++)
{
ddl.options[ddl.options.length]=new Option("item"+i,"item"+i);
}
}It says object doesn't support this property or method
CC26
modified on Friday, June 19, 2009 5:31 AM
Hi I have just copy and paste your function in my end and it works perfectly fine. I think problem is somewhere else.Which version of IE you are using?
himanshu
-
Hi I have just copy and paste your function in my end and it works perfectly fine. I think problem is somewhere else.Which version of IE you are using?
himanshu
thank u himangshu 4 ur reply.but i've solved the problem in other way.
CC26