Wanting to assign strings of text to certain checkboxes
Hello! I am building an audit checklist with a series of checkboxes alongside list items, with two dropdowns for each item (time frame and assignee). I would like the user to be able to check off anything they've already accomplished and for the remaining items, choose a 30 day, 60 day or 90 day timeframe as well as an assignee.
I will be creating summary boxes for each grouping of information, showing the item name and the assignee. I will be numbering the fields using sequential numbering and use code similiar to below (from a similar project I did a few years ago). Where I'm stuck is how to indicate what the item name is, since it will be static text, and not a field I can pull data from (which is how I accomplished this in the previous project). Can I set some variable to have a corresponding sequential numbering scheme and write out the list items in there? Where should I put that variable?
Secondly, as people check off remaining items, I want the piece from the summary box to disappear. I assume adding an if statement that checks for on/off of the checkbox, but I'm not quite certain how to structure that. (I have other times I've checked for on/off or yes/no from a series of checkboxes, but never inside of a loop like this.)
Here is the code I used for the previous project so you can see what I'm doing in building the summary fields!
var maxFields = 21;
var s = "";
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" || AcceptedStatus==" ") continue;
var funding=this.getField("FinalAmount"+i).value;
var fundingformat=util.printf("$%,0 0.0f", funding);
if (s!="") s+="; ";
s+=this.getField("FundingOpp"+i).valueAsString + ", " + fundingformat;
}
event.value = s;Many thanks if you can get me straightened out, this forum is so greatly helpful!
