Use a loop to check dropdown field answer, then add corresponding field to a summary box
I have a form with 21 rows and corresponding field names that range from 1-21. I would like to create a summary box on the final page of the document that checks the dropdown field titled "Status" and if the status is set to "Secured," to add the text in "FundingOpp" to the list (with a comma to separate entries). I set up a loop with my best guess of the coding to do this, but I am getting a syntax error in the code so I can't even test it. So I need help a) determining where the syntax error is and b) if the code as written (plus the edit for the error) will actually do what I'm guessing it will.
var maxFields = 21;
for (var i=1; i<=maxFields; i++) {
var AcceptedStatus = this.getField("Status"+i).valueAsString;
if (AcceptedStatus=="Submitted" || AcceptedStatus=="Denied" || AcceptedStatus=="Revisit at a Later Date") continue;
var s=this.getField("FundingOpp"+i).value + ", " +;}
event.value = s;
Error reads
"SyntaxError: syntax error
8: at line 9"
Thank you very much for any help you can provide!