little problem!!
-
hi all, on firefox this code work well ....but this not working on IE.....why?
for(var i =0 ;i< result.length;i++)
{
var obj = result[i];var sel = document.getElementById("Select"+obj.LoginId);
sel.value =obj.Skin;
} -
hi all, on firefox this code work well ....but this not working on IE.....why?
for(var i =0 ;i< result.length;i++)
{
var obj = result[i];var sel = document.getElementById("Select"+obj.LoginId);
sel.value =obj.Skin;
}zeeShan anSari wrote:
but this not working on IE.....
What do you mean by not working ? Are you getting any particular error ?
Abhijit Jana | Codeproject MVP Web Site : abhijitjana.net Don't forget to click "Good Answer" on the post(s) that helped you. View My Latest Article
-
zeeShan anSari wrote:
but this not working on IE.....
What do you mean by not working ? Are you getting any particular error ?
Abhijit Jana | Codeproject MVP Web Site : abhijitjana.net Don't forget to click "Good Answer" on the post(s) that helped you. View My Latest Article
sel.value =obj.Skin;
--> here obj.Skin is not assign in sel.Value here sel is select ok.... let's suppose
and now
var sel = document.getElementById('LoginId1');
sel.options.value ="SeaGreen";
but sel is still not selected in IE
thanks
modified on Wednesday, July 29, 2009 11:41 AM
-
sel.value =obj.Skin;
--> here obj.Skin is not assign in sel.Value here sel is select ok.... let's suppose
and now
var sel = document.getElementById('LoginId1');
sel.options.value ="SeaGreen";
but sel is still not selected in IE
thanks
modified on Wednesday, July 29, 2009 11:41 AM
for(var i =0 ;i< result.length;i++)
{
var obj = result[i];this is solution :)
var sel = document.getElementById("Select"+obj.LoginId);
switch(obj.Skin)
{
case 'LightBlue':
{
sel.options[0].selected=true;
break;
}
case 'SeaGreen':
{
sel.options[1].selected=true;
break;
}
case 'Orange':
{
sel.options[2].selected=true;
break;
}is it good logic?
-
hi all, on firefox this code work well ....but this not working on IE.....why?
for(var i =0 ;i< result.length;i++)
{
var obj = result[i];var sel = document.getElementById("Select"+obj.LoginId);
sel.value =obj.Skin;
}You need to write some debugging code to work out what is not working in IE. It's not uncommon to have to write script that works out what browser you are in, because of differences in the js language implimentations.
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.