mygrid.cells(i,1).getValue is not working sometimes

I had an issue in the data grid, I used following code to avoid duplicate entry in grid that code i have pasted below,

function addRow(){

    var pcode = document.getElementById('ProdCode').value;
    var tRows = mygrid.getRowsNum();
    var i = 1;
    var goAhead=true;
    for (i;i<=tRows;i++){

        if (mygrid.cells(i,1).getValue()==pcode)
    if (goAhead==false)
        alert(pcode + ", already entered");
        return false;
        reqObj=new XMLHttpRequest();
    }  else
        reqObj=new ActiveXObject('Microsoft.XMLHTTP');
    var queryString = '?id=' + pcode + ;


function processNewRow(){



My problem is, mygrid.cells(i,1).getValue() It recognized only the first click. Subsequent events it fails to trigger the function.

this works fine in firefox but in IE 6&7 it gives an issue like after 1 or sometimes 2 click the function does not get called.

Please kindly help me

Unfortunately the issue cannot be reconstructed locally.
Please, provide us with a complete demo where the issue can be reproduced.
Here you can find a tutorial: … leted_demo