rahulmca1
06-29-2007, 04:01 AM
A simple problem when I populate my combo using javascript my combo size changes (Problem is only on) Ie works ok in ff.
My code is
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>123</title>
<script type="text/javascript">
function test(){
var listFileClass = document.getElementById('listFileClass');
alert("listFileClass ="+listFileClass);
for (var loop = 0; loop < 6; loop=loop+1) {
var newDomainValueOption = document.createElement('option');
newDomainValueOption.setAttribute("value",loop);
newDomainValueOption.appendChild (document.createTextNode(loop));
listFileClass.appendChild(newDomainValueOption);
}
}
</script>
</head>
<body>
<table>
<tr>
<td width="100%">
<select style="width:100%" name="listFileClass" id="listFileClass">
</select>
</td>
<td>
<input type="button" value="test" onclick="test();">
</td>
</tr>
</table>
</body>
</html>
My code is
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>123</title>
<script type="text/javascript">
function test(){
var listFileClass = document.getElementById('listFileClass');
alert("listFileClass ="+listFileClass);
for (var loop = 0; loop < 6; loop=loop+1) {
var newDomainValueOption = document.createElement('option');
newDomainValueOption.setAttribute("value",loop);
newDomainValueOption.appendChild (document.createTextNode(loop));
listFileClass.appendChild(newDomainValueOption);
}
}
</script>
</head>
<body>
<table>
<tr>
<td width="100%">
<select style="width:100%" name="listFileClass" id="listFileClass">
</select>
</td>
<td>
<input type="button" value="test" onclick="test();">
</td>
</tr>
</table>
</body>
</html>