Hi,
I have a embeded js script which is used everytime the form is loaded. There is a Grid (Grid1) on the form (AddFund) and this script basically color the cells based on the value in variable 'strCellGet'. The code is as below:

Code:
 function addLoadEvent(func) {
 var oldonload = window.onload;
 if (typeof window.onload != 'function') {
 window.onload = func;
 } else {
 window.onload = function() {
 if (oldonload) {
 oldonload();
 }
 func();
 }
 }
 }
 
 addLoadEvent(function() {
 
 alert('DORMANT Records Should not be Modified. Please make it ACTIVE before
 doing any Modification.');
 
 numRows = AddFund.Grid1.GetNumberRows();
 
 var count = 0;
 var cntCol = 1;
 for ( count = 0;count <numRows ; count++)
 {
 AddFund.Grid1.GetCell(13,count);
 var StrCellGet = AddFund.Grid1.CellGetText;
 
 if (StrCellGet == 'DORMANT')
 {
 for ( cntCol = 1; cntCol < 13 ; cntCol++)
 {
 AddFund.Grid1.GetCell(cntCol,count);
 AddFund.Grid1.CellSetBackColor(0xc0c0c0);
 AddFund.Grid1.CellSetTextColor(0xc0c0c0);
 AddFund.Grid1.CellSetReadOnly(1);
 AddFund.Grid1.SetCell(cntCol,count);
 AddFund.Grid1.RedrawAll();
 }
 }
 
 }
 
 })
This code works fine with alert('DORMANT Records Should not be Modified. Please make it ACTIVE before doing any Modification.');
The problem is that if i remove alert function in addLoadEvent the code above it does not work. I dont want alert in my code. As per my understanding it should work fine without alert function. What can be the reason of this misbehaviour. Please advice.


Thanks in advance.
Anil