if (fc == "A" || fc == "C") // <-- this is testing for the main form action (add or change) { for (i = 0; i <= 4; i++) // <-- this is iterating through your 5 detail lines. { //Check for Detail Area for required fields if adding or changing a line. dlLineFC = lawForm.getDataValue("LINE-FC",i);
if (dlLineFC == "A" || dlLineFC == "C") // <--- this is checking the action selected in the detail line FC. { // do some stuff } } }