mattquantic
Programmer
Hi. I am dynamically populating a dropdown. But for some reason it works in Moz but not IE???
The code is simple and i just don't see whats not right...
Weird??
M@)
The code is simple and i just don't see whats not right...
Code:
<script type="text/javascript" language="JavaScript">
function populateDrop(){
for(var i = 1;i <= jsaysType1_1.length; i++){
var newoption = new Option(jsaysType1_1[i].thename,jsaysType1_1[i].value);
//this for ie (dynamically left out by server if not ie)
document.AddEditProducts.Type1_1.add(newoption);
//this for moz(dynamically left out by server if not moz)
document.AddEditProducts.Type1_1.add(newoption,null);
if(jsaysType1_1[i].selected == 1){
document.AddEditProducts.Type1_1[i].selected = true;
document.AddEditProducts.Type1_1[i].style.color = "#ffffff";
document.AddEditProducts.Type1_1[i].style.backgroundColor = "#005F8C";
}
else{
document.AddEditProducts.Type1_1[i].selected = false;
}
}
}
</script>
<form name="AddEditProducts" method="post" action="/admin/addedit_product.cfm" enctype="multipart/form-data">
<select name="Type1_1" class="form_input">
<option value="" style="background-color:#C0D9E4;color:#373666;">Type</option>
<script type="text/javascript" language="JavaScript">
jsaysType1_1 = new Array();
jsaysType1_1[1] = new Object();
jsaysType1_1[1].thename = 'angels';
jsaysType1_1[1].value = '20';
</script>
</select>
<script type="text/javascript" language="JavaScript">
populateDrop('jsaysType1_1','Type1_1','AddEditProducts');
</script>
</form>
Weird??
M@)