hey guess ....im having some problem with my browser. my script runs well in FF but it saisy object null in IE....plz can anybody see this code and tell me where i did make mistake ? here im trying to create dynamic rows by onclick. another function whick is belongs to another table will create more columns depending to the rows. so what im trying to do is im calling the function at the end of the function so that it can dynamically change.
THIS IS THE FUNC that im calling at the end of another function -->
at the end of another function im calling above function like this --->
this is the HTML table where table will be changed dynamically ....
[HTML] <div id="hidesave" style=" width:620px; height:178px;ov erflow-x:auto; overflow-y:auto;" class="listform table">
<table border="0" title="Show Chart">
<!--DWLayoutTable-->
<tbody id="testbody">
</tbody>
</table>
</div>[/HTML]
Please post code in tags - moderator
guys it works fine in FF ....but IE !...plz help me !!
thanks in advance ...:)
THIS IS THE FUNC that im calling at the end of another function -->
Code:
func test (id)
var hmrc=0;
var newrow;
var tbl;
var newcol , newinput;
var loopcounter=0;
tbl = doc.getElementById(id);
//create a new row
newrow = doc.createElement("TR");
newcol = doc.createElement("TD");
newcol.width = 80;
newrow.appendChild(newcol);
while ( loopcounter<x ){
newcol = doc.createElement("TD");
newcol.width = 80;
//newcol.setAttribute((document.all ? "className" : "class"), "dtext");
newcol.innerHTML = col1[loopcounter];
newrow.appendChild(newcol);
loopcounter++;
}
tbl.appendChild(newrow);
__uid1++;
var loopcounter=0;
tbl = doc.getElementById(id);
//create a new row
newrow = doc.createElement("TR");
newcol = doc.createElement("TD");
newcol.width = 80;
newrow.appendChild(newcol);
while ( loopcounter<x ){
newcol = doc.createElement("TD");
newcol.width = 80;
newcol.innerHTML =col2[loopcounter];
newrow.appendChild(newcol);
loopcounter++;
}
tbl.appendChild(newrow);
__uid1++;
h=parseInt (doc.getElementById('hrm').value);
//alert(h);
var ii= 0;
var jj = 0;
while (hmrc<h){
loopcounter=0;
newrow = doc.createElement("TR");
newcol = doc.createElement("TD");
newcol.width = 80;
newcol.innerHTML="Test "+hmrc;
newrow.appendChild(newcol);
jj = 0;
while ( loopcounter<x ){
newcol = doc.createElement("TD");
newcol.width = 80;
newinput = doc.createElement("input");
newinput.name = "data[test]["+loopcounter+"]["+hmrc+"]";
newinput.size = 15;
newinput.value = "0";
newinput.id = "input"+ii+jj;
newcol.appendChild(newinput);
newrow.appendChild(newcol);
loopcounter++;
jj ++;
}
tbl.appendChild(newrow);
hmrc++;
ii++;
}
}
at the end of another function im calling above function like this --->
Code:
if(doc.getElementById('showchart').value=="Refresh"){
test('testbody');
}
[HTML] <div id="hidesave" style=" width:620px; height:178px;ov erflow-x:auto; overflow-y:auto;" class="listform table">
<table border="0" title="Show Chart">
<!--DWLayoutTable-->
<tbody id="testbody">
</tbody>
</table>
</div>[/HTML]
Please post code in tags - moderator
guys it works fine in FF ....but IE !...plz help me !!
thanks in advance ...:)
Comment