PDA

View Full Version : how can I count the columns in one row?



SBUH
August 22nd, 2003, 05:26 AM
My situation like this:

Table1
ID Col Col2 Col3.... Coln
.....
2 x null null .... xxx
....


Now I want to count how many Columns in one row havenot null values.
For the upper table row 2, the counter should return 2 to me.

Thanks!

DigitalPimp
August 22nd, 2003, 12:42 PM
Here you go man just give all the TDs the same ID name.



<SCRIPT>
var i = 0;
function checkIt() {
var TDlength = TDUnfold.length;
while (i<TDlength) {
if (TDUnfold[i].innerText != "") {
alert(i + " isn't blank");

}
i++;
}
}
</SCRIPT>