I have prepared a form that will do the following (please bear with me for the description):
The form opens with a 10-row table. The user must enter ratings (from 0 to 10) in one of the table's columns. Once the user enters all ten ratings, he or she must then click a button to enable the rest of the form (which is hidden). What I am trying to do is, after the button is clicked, scan the table to make sure the entire column has been filled in with a number. If the column has been completed then a second page will appear. If a cell in the column has been left blank, then I want a prompt to appear and tell the user which cell is empty. I have been able to get it to work using the following code:
//This code is under the 'click' event.
if (decisionMatrix.dMTable.Row4.rating.rawValue == null)
{
//Displays a warning prompt that states form is incomplete
xfa.host.messageBox("Form incomplete. Please complete the background field.", "Warning", 3);
}
else
{
// Allow the user to save the current state of the form and enable the second part of form.
app.execMenuItem("SaveAs");
}
The problem with the above method is that it only checks the cell in Row4. I would have to add more code for the 9 additional rows in the table and for each message box, telling the user which field to fill in. Is there a more efficient way to do this? A switch-case statement perhaps?
I have also considered scanning the entire column at once and just using a general message box for the table, using the following code:
if (decisionMatrix.dMTable.Row[*].rating.rawValue == null)
{
//Displays a warning prompt that states form is incomplete
xfa.host.messageBox("Form incomplete. Please complete all rating fields.", "Warning", 3);
}
...
But it does not seem to be working. Any assistance is appreciated. Thanks.