I wrote a simple code in java script and it is working fine with IE and not in Firefox but the out put in php array count is correct in IE but not correct in Firefox
<script language="javascript">
var arrdimensions = {
"codimesion":{"s":{'0':'dimesion1','1':'dimesion2','2':'dimesion3','3':'dimesion4','4':'dimesion5','5':'dimesion6','6':'dimesion7'},"c":1,"m":"50", "sc":1, "f":"nopcs[]"}
};
function adddimensions(what) {
parentId = gbi(what);
var count = 0;
for (idx in arrdimensions[what]) {
count++;
}
var trElem = document.createElement('tr');
var contentId;
var txt = new Array();
for (var i=0; i<count; i++) {
var tdElem = document.createElement('td');
tdElem.innerHTML = gbi(arrdimensions[what]).innerHTML;
trElem.appendChild(tdElem);
}
parentId.appendChild(trElem);
var f = document.getElementsByName(arrdimensions[what]["f"]);
f[arrdimensions[what]["c"] + arrdimensions[what]["sc"]].focus();
// f[arrdimensions[what]["c"]+arrdimensions[what]["sc"]].focus();
arrdimensions[what]["c"] += arrdimensions[what]["sc"];
return true;
}
function gbi(layerid) {
return document.getElementById(layerid);
}
</script>
<table width="360" border="1">
<tbody id="codimesion">
<form name ="form1" >
<tr style="display:none;">
<td id="dimesion1" width="30" ><input type="text" name="nopcs[]" size="5" /></td>
<td id="dimesion2" width="34"><input type="text" name="leng1[]" size="5"/></td>
<td id="dimesion3" width="34" ><input type="text" name="width1[]" size="5"/></td>
<td id="dimesion4" width="34"><input type="text" name="height1[]" size="5" /></td>
<td id="dimesion5" width="77"><input type="text" name="cweight[]" size="12" /></td>
<td id="dimesion6" width="75"><input type="text" name="gweight[]" size="12" /></td>
<td id="dimesion7" width="74"><input type="text" name="cbmcft1[]" size="12" /></td>
</tr>
</form>
</tbody>
</table>