Hi All,
I have a form which has a lot of numeric fields. The fields accept integer values only. I need to make sure that no field contains a negative integer.
I have the following script which is failing at the point app.alert("Called"); i.e. the innermost if. Please Help. I have a deadline and I am stuck at this last thing.
function testAll()
{
for (var nPageCount = 0; nPageCount < xfa.host.numPages; nPageCount++)
{
var oFields = xfa.layout.pageContent(nPageCount, "field");
var nNodesLength = oFields.length;
var sProperty = "rawValue";
var sFillColor = "fillColor";
var sFillColorRed = "255,0,0";
var sFillColorWhite = "255,255,255";
var sValue = "0";
for (var nNodeCount = 0; nNodeCount < nNodesLength; nNodeCount++)
{
if (oFields.item(nNodeCount).ui.oneOfChild.className == "numericEdit") // if it is a numeric field
{
if ((oFields.item(nNodeCount).ui.oneOfChild)[sFillColor] == sFillColorRed )) // value is less than 0
{
app.alert("Called");
//(oFields.item(nNodeCount).ui.oneOfChild)[sFillColor] = sFillColorRed;
}
}
}
}
} // end function