I need help handling NULLs. Where is fails is the " if((_values != null)
|| (_values != "")) ". It is supposed to detect the NULL and then execute
the ... = "" statement. When I add a window.alert statement, it returns a
NULL, but the IF clause here fails for some reason and pumps the NULL into
the textbox anyways.
if(row.getRowType() == "Record")
{
var _cell = null;
var _values = "";
_cell = row.getCellByColumnKey("DueDate");
_values += _cell.getValue();
if((_values != null) || (_values != ""))
{ document.frmCaseSummary.txtPleadingsDueDate.value = _values; }
else
{ document.frmCaseSummary.txtPleadingsDueDate.value = ""; }
}
else
{
document.frmCaseSummary.txtPleadingsDueDate.value = "";
}
Please help.
TIA
John Cosmas
Chris R. Timmons - 26 Nov 2004 05:16 GMT
> I need help handling NULLs. Where is fails is the "
> if((_values != null)
[quoted text clipped - 20 lines]
> document.frmCaseSummary.txtPleadingsDueDate.value = "";
> }
John,
Change the || to &&. In other words, the if statement should read
like this: "if _values is not equal to null, AND _values is not
empty, then..."

Signature
Hope this helps.
Chris.
-------------
C.R. Timmons Consulting, Inc.
http://www.crtimmonsinc.com/