Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Loop validating newly added rows

advboss-A8f11q
Level 2
Level 2

Hello dear livecycle fans!

I think that I looked everywhere for my rather simple question. Here it is:

I have a table with a header row and 1 row and a New Row button (which adds a new row to the table) BUT I want that button to validate the last row (to check if everything is fullfilled). It may also validate all rows, doesn't really matter.

My code looks like this:

var valid = true;

      for (var i=1; i < Table1.Row.instanceManager.count; i++)
{
if (form1.page1.tabform.Table1.Row(i).field.rawValue == null || form1.page1.tabform.Table1.Row(i).field.rawValue.length == 0); {
xfa.host.messageBox("You are missing a field!");
valid=false; }
}

Of course when the valid = true it adds new row. However - this validation doesn't work
why is that? Would you be so kind and help me out with one. The code looks simple and straightforward and I really don't know what I'm doing wrong.

Thank you! PS. wow this post editor is really messed up on Opera

1 Accepted Solution
advboss-A8f11q
Correct answer by
Level 2
Level 2
1 Reply
advboss-A8f11q
Correct answer by
Level 2
Level 2