dcsimg
www.webdeveloper.com
Results 1 to 4 of 4

Thread: null value

  1. #1
    Join Date
    Jan 2003
    Posts
    25

    null value

    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

  2. #2
    Join Date
    Nov 2002
    Posts
    631

    Re: null value

    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
    }

  3. #3
    Join Date
    Jan 2003
    Posts
    25
    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

  4. #4
    Join Date
    Jan 2003
    Posts
    25
    thanks! I have fixed the bug. :P

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles