Click to See Complete Forum and Search --> : null value


glotsa
02-10-2003, 09:17 PM
Pls kindly help for the following code

for (var i=1;i<=TotalQuestion;i++){
var objCell = Qtable.rows[i].cells;
if (objCell[9].innerText!=null){ check whether the cell value is null or not
//do sth
}
}

i have tested that even if the cell value is null, but it still enter to the if loop.

i have tried to correct objCell[9].innerText!="" instead of objCell[9].innerText!=null , but it still can't work...

pls help :P

Zach Elfers
02-10-2003, 09:22 PM
Originally posted by glotsa
for (var i=1;i<=TotalQuestion;i++){
var objCell = Qtable.rows[i].cells;
if (objCell[9].innerText!=null){ check whether the cell value is null or not
//do sth
}
}


I am not sure if this will fix your problem, but you forgot to start your comment in the if statment:

if (objCell[9].innerText!=null){ //check whether the cell value is null or not
//do sth
}

glotsa
02-10-2003, 09:33 PM
Oh, it is just a typing mistake, in my origional code, there is no comment in it.

i think there is some wrong in this statment: objCell[9].innerText!=null

glotsa
02-11-2003, 12:05 AM
thanks! I have fixed the bug. :P